Skip to content

Reaction bot #234

Answered by dolfies
Vsbsmfd asked this question in Help
Mar 8, 2022 · 1 comments · 14 replies
Discussion options

You must be logged in to vote

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')

Replies: 1 comment 14 replies

Comment options

You must be logged in to vote
14 replies
@dolfies
Comment options

@dolfies
Comment options

@Vsbsmfd
Comment options

@dolfies
Comment options

@Vsbsmfd
Comment options

Answer selected by Vsbsmfd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants