I've been troubleshooting this thing for days and this is the last straw.
Reaction_add
only works if I do !on_message
in the server 'general' channel, if I directly message the bot, it doesn't do anything. Though, funny thing is, if I message bot directly first and the enter !on_message
in server general channel, bot reacts in general channel and in direct messages.
After TimeoutError
I get thumbs down in direct messages.
This is the code, straight from discord.py documentation and I'm using Bot
as Client
:
@bot.command(pass_context=True)
async def on_message(ctx):
channel = ctx.channel
await ctx.send('Send me that ?? reaction, mate')
def check(reaction, user):
return user == ctx.author and str(reaction.emoji) == '??'
try:
reaction, user = await bot.wait_for('reaction_add', timeout=60.0, check=check)
except asyncio.TimeoutError:
await channel.send('??')
else:
await channel.send('??')
It's funny that wait_for(message, ...)
message works just fine everywhere.
Tried adding this and still no luck.
intents = discord.Intents.default()
intents.dm_reactions = True
bot = commands.Bot(command_prefix=PREFIX, description=DESCRIPTION, intents=intents)
question from:https://stackoverflow.com/questions/65927848/discord-reaction-add-doesnt-work-in-direct-message-channel