File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ apt-get -y install python3 python3-pip
1010``
1111
1212``
13- python3 -m pip install discord.py==1.3.4
13+ python3 -m pip install discord.py==2.0.1
1414``
1515
1616## HOW TO USE
Original file line number Diff line number Diff line change 55# DEPENDENCIES
66# sudo apt-get install python3
77# sudo apt-get -y install python3-pip
8- # python3 -m pip install discord.py==1.3.4
8+ # python3 -m pip install discord.py==2.0.1
99#
1010# HOW TO USE
1111# Go to https://discordapp.com/developers/applications/
2121import random
2222import asyncio
2323import aiohttp
24+ import discord
2425import json
2526from discord .ext import commands
2627from discord .ext .commands import Bot
4748PORT = "YOUR_RPC_PORT_GOES_HERE"
4849
4950# start a bot
50- client = Bot (command_prefix = BOT_PREFIX , description = description )
51+ intents = discord .Intents .all ()
52+ client = Bot (command_prefix = BOT_PREFIX , description = description , intents = intents )
5153
5254# commmand: &height
5355# network top block height
@@ -146,6 +148,9 @@ async def list_servers():
146148 print ('Active servers: ' + str (server .name ))
147149 await asyncio .sleep (600 )
148150
151+ async def main ():
152+ async with client :
153+ await client .loop .create_task (list_servers ())
149154
150- client .loop .create_task (list_servers ())
151155client .run (TOKEN )
156+ asyncio .run (main ())
You can’t perform that action at this time.
0 commit comments