add delete original message after 10 sec
This commit is contained in:
10
main.py
10
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'])
|
||||
|
||||
Reference in New Issue
Block a user