diff --git a/kabot/kabot/kabot.py b/kabot/kabot/kabot.py index c200297..df2863b 100644 --- a/kabot/kabot/kabot.py +++ b/kabot/kabot/kabot.py @@ -159,15 +159,17 @@ def main(): @aiocron.crontab('50 9-23/1 * * *') async def kron(): - if random.choice([True,True,True]): + kron_choice = random.choice(["kaamelott","slap","kaamelott",False]) + if kron_choice: + sleep(random.choice(range(3550))) for channel in bot.get_all_channels(): if channel.name == "général": current_chan = channel ctx = await bot.get_context(current_chan.last_message) ctx.message.content = "" print(ctx.message.content) - kaamelott = bot.get_command('kaamelott') - await kaamelott.invoke(ctx) + random_cmd = bot.get_command(kron_choice) + await random_cmd.invoke(ctx) @aiocron.crontab('*/5 * * * *') async def pipelette(): @@ -178,7 +180,7 @@ def main(): for channel in bot.get_all_channels(): if channel.name == "général": current_chan = channel - #sleep(random.choice(range(350))) + sleep(random.choice(range(350))) ctx = await bot.get_context(current_chan.last_message) ctx.message.content = "" joke = bot.get_command('joke')