Reaction bot
#234
-
Has anyone created a bot that can monitor a server for a specific phrase in a message, and then react to that message with a specific emoji and repeat? |
Beta Was this translation helpful? Give feedback.
Answered by
dolfies
Mar 8, 2022
Replies: 1 comment 14 replies
-
You can do this easily by adapting the example in the README. import discord
ALLOWED_GUILDS = (123, 456, 789)
class MyClient(discord.Client):
async def on_ready(self):
print('Logged on as', self.user)
async def on_message(self, message):
# don't respond to ourselves
if message.author == self.user:
return
if message.guild.id in ALLOWED_GUILDS and 'phrase' in message.content:
await message.add_reaction('👍')
client = MyClient()
client.run('token') |
Beta Was this translation helpful? Give feedback.
14 replies
Answer selected by
Vsbsmfd
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can do this easily by adapting the example in the README.