try to fix sleep

This commit is contained in:
Milka64 2019-11-18 21:17:12 +01:00
parent 0f997c8168
commit 9681bb6067

View file

@ -166,7 +166,7 @@ def main():
async def kron(): async def kron():
kron_choice = random.choice(["kaamelott","slap","kaamelott",False]) kron_choice = random.choice(["kaamelott","slap","kaamelott",False])
if kron_choice: if kron_choice:
asyncio.sleep(random.choice(range(3550))) await asyncio.sleep(random.choice(range(3550)))
for channel in bot.get_all_channels(): for channel in bot.get_all_channels():
if channel.name == "général": if channel.name == "général":
current_chan = channel current_chan = channel
@ -185,7 +185,7 @@ def main():
for channel in bot.get_all_channels(): for channel in bot.get_all_channels():
if channel.name == "général": if channel.name == "général":
current_chan = channel current_chan = channel
asyncio.sleep(random.choice(range(350))) await asyncio.sleep(random.choice(range(350)))
ctx = await bot.get_context(current_chan.last_message) ctx = await bot.get_context(current_chan.last_message)
ctx.message.content = "" ctx.message.content = ""
joke = bot.get_command('joke') joke = bot.get_command('joke')