I am trying to make my discord bot react to its own message, pretty much. The system works like this:
A person uses the command !!bug - And gets a message in DM', she/she is supposed to answer those questions. And then whatever he/she answered, it will be transferred an embedded message to an admin text-channel.
But I need to add 3 emojis, or react with three different emojis. And depending on what the admin chooses, it will transfer the message once more. So if an admin reacts to an emoji that equals to "fixed", it will be moved to a "fixed" text-channel (the entire message).
I have done a lot of research about this, but only found threads about the old discord.py, meaning
await bot.add_react(emoji)
- But as I have understood it, that no longer works!
Here is my code:
import discord
from discord.ext import commands
import asyncio
TOKEN = '---'
bot = commands.Bot(command_prefix='!!')
reactions = [":white_check_mark:", ":stop_sign:", ":no_entry_sign:"]
@bot.event
async def on_ready():
print('Bot is ready.')
@bot.command()
async def bug(ctx, desc=None, rep=None):
user = ctx.author
await ctx.author.send('```Please explain the bug```')
responseDesc = await bot.wait_for('message', check=lambda message: message.author == ctx.author, timeout=300)
description = responseDesc.content
await ctx.author.send('````Please provide pictures/videos of this bug```')
responseRep = await bot.wait_for('message', check=lambda message: message.author == ctx.author, timeout=300)
replicate = responseRep.content
embed = discord.Embed(title='Bug Report', color=0x00ff00)
embed.add_field(name='Description', value=description, inline=False)
embed.add_field(name='Replicate', value=replicate, inline=True)
embed.add_field(name='Reported By', value=user, inline=True)
adminBug = bot.get_channel(733721953134837861)
await adminBug.send(embed=embed)
# Add 3 reaction (different emojis) here
bot.run(TOKEN)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…