Hey guys!
Can anybody help me how to get a simple example of server running with a task loop?
I tried this example but didnt work:
import disnake
client = disnake.Client()
@client.event
async def on_ready():
print(f'We have logged in as {client.user}')
@client.event
async def on_message(message):
if message.author == client.user:
return
if message.content.startswith('$hello'):
await message.channel.send('Hello!')
@tasks.loop(seconds=5.0)
async def docheck():
print("Running new check.")
#for summoner in watchedSummoners:
#if summonerExists(summoner):
#await gameCheck()
#await gamerCheck(summoner)
client.run('token')
docheck.start()