因此,我正在尝试向机器人在文本通道中发送的消息添加三种不同的反应(表情符号)。
用户在他们的 DM 中填写一个表格,然后消息被发送到一个名为“admin-bug”的文本通道,然后服务器的管理员可以对三种不同的表情符号做出反应:
固定的
不会被修复
不是错误
然后,根据管理员按下的表情符号,消息将被传输到文本频道。
但!我似乎无法弄清楚您实际上是如何将反应添加到消息本身的,我已经进行了大量的谷歌搜索,但找不到答案。
代码:
import discord
from discord.ext import commands
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)
白猪掌柜的
慕森卡
MMTTMM
绝地无双
相关分类