use the interval trigger keyword
This commit is contained in:
parent
03968df87b
commit
4ab45cd8bc
1 changed files with 1 additions and 2 deletions
|
@ -5,7 +5,6 @@ import discord
|
||||||
from discord.ext import commands, tasks
|
from discord.ext import commands, tasks
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from apscheduler.schedulers.asyncio import AsyncIOScheduler
|
from apscheduler.schedulers.asyncio import AsyncIOScheduler
|
||||||
from apscheduler.triggers import IntervalTrigger
|
|
||||||
|
|
||||||
# Read env variables
|
# Read env variables
|
||||||
bot_token = os.environ.get('DISCORDBOT_TOKEN', 'token')
|
bot_token = os.environ.get('DISCORDBOT_TOKEN', 'token')
|
||||||
|
@ -67,7 +66,7 @@ async def time(ctx):
|
||||||
@bot.command(name='start')
|
@bot.command(name='start')
|
||||||
async def start_task(ctx):
|
async def start_task(ctx):
|
||||||
# Schedule a task to run every 5 seconds
|
# Schedule a task to run every 5 seconds
|
||||||
scheduler.add_job(func=my_task, trigger=IntervalTrigger(seconds=5), id='my_task_id')
|
scheduler.add_job(func=my_task, trigger='interval', seconds=5, id='my_task_id')
|
||||||
#scheduler.add_job(func=tick, id='tick_id', args=(ctx))
|
#scheduler.add_job(func=tick, id='tick_id', args=(ctx))
|
||||||
#channel = bot.get_channel(channel_id)
|
#channel = bot.get_channel(channel_id)
|
||||||
#if channel:
|
#if channel:
|
||||||
|
|
Loading…
Reference in a new issue