From 59c5df71afc2e38d52b55d33f121476a2015131b Mon Sep 17 00:00:00 2001 From: anima Date: Mon, 29 Nov 2021 23:17:54 +0100 Subject: [PATCH] add delete original message after 10 sec --- main.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index bac6325..ed48f1e 100644 --- a/main.py +++ b/main.py @@ -15,13 +15,13 @@ #################### ## Imports -import asyncio -import json +import asyncio as aio import logging as log +import json import random from discord.ext import commands -from lib.keep_alive import keep_alive +#from lib.keep_alive import keep_alive ## Vars ### Load and set Bot Config @@ -57,7 +57,7 @@ async def say_hello(ctx): print(ctx.message.content) print(ctx.message) print(ctx.author) - await asyncio.sleep(random.randint(1,5)) + await aio.sleep(random.randint(1,5)) await ctx.message.remove_reaction('🤔', bot.user) if random.randint(1,100) < 10: log.error('say_hello function was failed') @@ -65,6 +65,8 @@ async def say_hello(ctx): else: log.info('Run say_hello successfully') await ctx.message.add_reaction('✅') + await aio.sleep(10) + await ctx.message.delete() #keep_alive() bot.run(BOTDATA['token'])