I am making a Discord.py bot that uses DMs. I have a command where the bot will DM you asking for you to react to the action you are trying to do the issue is when the user adds the reaction it doesn't work.
Here's what I have so far
@client.command()
async def suggest(ctx):
embed = discord.Embed(
title = 'What kind of suggestion are you making?',
description = '<:Yes:755187983585509517> Car Suggestion\n<:Maybe:755187983623258123> Job Suggestion\n<:No:755187984067854367> Other Suggestion Type',
colour = discord.Colour.green()
)
await ctx.message.delete()
await ctx.send(f'{ctx.message.author.mention} Please check your DMs to continue!')
embed.set_footer(text='Pembroke Pines Bot - Made By: parker02311')
msg = await ctx.author.send(embed=embed)
await msg.add_reaction('<:Yes:755187983585509517>')
await msg.add_reaction('<:Maybe:755187983623258123>')
await msg.add_reaction('<:No:755187984067854367>')
def check(reaction, user):
return user == msg.author and str(reaction.emoji) == '<:Yes:755187983585509517>'
try:
reaction, user = await client.wait_for('reaction_add', timeout=60.0, check=check)
except asyncio.TimeoutError:
await ctx.author.send("Timed out")
else:
embed = discord.Embed(
title = 'Car Suggestion',
description = 'What is your username?',
colour = discord.Colour.green()
)
embed.set_footer(text='Pembroke Pines Bot - Made By: parker02311')
await ctx.author.send(embed=embed)
def check(m):
return m.content
msg = await client.wait_for('message', check=check)
await ctx.author.send(f'Okay, your username is: **{msg}**')
embed = discord.Embed(
title = 'Car Suggestion',
description = 'What is the car model?',
colour = discord.Colour.green()
)
embed.set_footer(text='Pembroke Pines Bot - Made By: parker02311')
await ctx.author.send(embed=embed)
msg = await client.wait_for('message', check=check)
await ctx.author.send(f'Okay, the model is: **{msg}**')
#channel = client.get_channel(734882692537253900)
embed = discord.Embed(
description = f'{ctx.message.author.mention} **made a suggestion\nChannel:** {ctx.message.channel}\n**Message Content:** {ctx.message.content}',
colour = discord.Colour.red()
)
embed.set_footer(text='Pembroke Pines Bot - Made By: parker02311')
embed.set_author(name=ctx.message.author)
await logschannel.send(embed=embed)
That's taken pretty much straight out of the discord.py docs. https://discordpy.readthedocs.io/en/latest/api.html#discord.Client.wait_for