So basically i was making a modmail system and the problem was we wanted the person who dmed the bot has to react to ? if he reacts then the bot has to reply him "OK" but the code was not working so what is the problem how to fix it?
import discord
import asyncio
client = discord.Client()
@client.event
async def on_message(message):
# empty_array = []
# modmail_channel = discord.utils.get(client.get_all_channels(), name="mod-mail")
if message.author == client.user:
return
if str(message.channel.type) == "private":
embed = discord.Embed(title='Confirmation',
color=0x03d692)
embed.add_field(name="You're sending this message to **The Dynamic Legends**", value="React with :white_check_mark: to confirm." + "
To cancel this request, react with :x:.", inline=False)
confirmation_msg = await message.author.send(embed=embed)
await confirmation_msg.add_reaction('?')
await confirmation_msg.add_reaction('?')
sent_users = []
sent_users.append(message.author.name)
try:
print('Working')
def check1(reaction, user):
return user == client.user and user!='Mod Mail Humara#5439' and str(reaction.emoji) == '?'
reaction, user = await client.wait_for("reaction_add", timeout=30.0, check=check1)
# print(reaction, user)
if str(reaction.emoji) == '?':
message.author.send('yes)
client.run('TOKEN')
question from:https://stackoverflow.com/questions/65643996/cannot-check-reaction-in-discord-py