1
0
Fork 0
mirror of https://gitlab.jonasled.de/jonasled/discordbot synced 2024-08-01 15:04:39 +02:00

react on hi @bot and @bot hi

This commit is contained in:
Jonas Leder 2020-04-02 20:45:34 +02:00
parent ae790d8fc1
commit 16f697039a

3
bot.py
View file

@ -49,6 +49,9 @@ async def on_message(message):#this will run on every message
if message.content.startswith(prefix): #check if the message starts with the prefix, if yes process the command
await bot.process_commands(message)
if "<@!" + str(bot.user.id) + ">" in message.content:
if (message.content[:3] == "hi ") or (message.content[-3:] == " hi"):
await message.channel.send("Hello <@!" + str(message.author.id) + "> To get a list of my commands enter " + prefix + "help.")
@bot.event
async def on_raw_reaction_add(message): #this runs on every reaction