How do make a simple bot that auto reacts to every message in channel

I have this code, in cog, it doesn't do anything and I dont have any errors, discord.py. I want the bot to auto react on every message in specific channel

from discord.ext import commands from discord.ext.commands import Bot import asyncio client = commands.Bot(command_prefix = '*') class Autoreact(commands.Cog): def __init__(self, client): self.client = client @commands.Cog.listener() async def on_message(self, message): if (message.channel.id == "817770701603340289"): await message.add_reaction(":daek:817793235988643861") def setup(client): client.add_cog(Autoreact(client)) 

1 Answer

ID's are integers, not strings

@commands.Cog.listener() async def on_message(self, message): if message.channel.id == 817770701603340289: await message.add_reaction(":daek:817793235988643861") 

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like