From 123f1a0c65ce580efaa7e1f8f6a4e60606823591 Mon Sep 17 00:00:00 2001 From: deflax Date: Tue, 16 Jan 2024 19:18:10 +0200 Subject: [PATCH] remove the task decoration --- src/discordbot/discordbot.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/discordbot/discordbot.py b/src/discordbot/discordbot.py index 9e4f813..64bcb57 100644 --- a/src/discordbot/discordbot.py +++ b/src/discordbot/discordbot.py @@ -66,7 +66,7 @@ async def time(ctx): @bot.command(name='start') async def start_task(ctx): # Schedule a task to run every 5 seconds - scheduler.add_job(func=my_task, id='my_task_id') + await scheduler.add_job(func=my_task, id='my_task_id') #scheduler.add_job(func=tick, id='tick_id', args=(ctx)) #channel = bot.get_channel(channel_id) #if channel: @@ -78,7 +78,6 @@ async def show_task(ctx): global counter await ctx.channel.send(str(counter)) -@tasks.loop(seconds=10) async def my_task(): global counter counter += 1