add status emoji reation
This commit is contained in:
13
main.py
13
main.py
@@ -15,8 +15,10 @@
|
||||
####################
|
||||
|
||||
## Imports
|
||||
import asyncio
|
||||
import json
|
||||
import logging as log
|
||||
import random
|
||||
|
||||
from discord.ext import commands
|
||||
from lib.keep_alive import keep_alive
|
||||
@@ -48,12 +50,21 @@ async def on_ready():
|
||||
### Commands
|
||||
@bot.command(name='hello', help='Say hello!')
|
||||
async def say_hello(ctx):
|
||||
print(f'{ctx}')
|
||||
log.info('Start say_hello function')
|
||||
await ctx.message.add_reaction('🤔')
|
||||
await ctx.send(f'Hello, <@{ctx.author.id}>!')
|
||||
print(ctx.guild)
|
||||
print(ctx.message.content)
|
||||
print(ctx.message)
|
||||
print(ctx.author)
|
||||
await asyncio.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')
|
||||
await ctx.message.add_reaction('❌')
|
||||
else:
|
||||
log.info('Run say_hello successfully')
|
||||
await ctx.message.add_reaction('✅')
|
||||
|
||||
#keep_alive()
|
||||
bot.run(BOTDATA['token'])
|
||||
|
||||
Reference in New Issue
Block a user