小编sim*_*jöö的帖子

Discord.py - 让机器人对其自己的消息做出反应

我试图让我的不和谐机器人对它自己的消息做出反应,几乎。系统是这样工作的:

一个人使用命令!!bug - 并在 DM' 中收到一条消息,她/她应该回答这些问题。然后无论他/她回答什么,它都会将嵌入的消息传输到管理员文本通道。

但我需要添加 3 个表情符号,或者用三个不同的表情符号做出反应。并且根据管理员的选择,它将再次传输消息。因此,如果管理员对等于“固定”的表情符号做出反应,它将被移动到“固定”文本通道(整个消息)。

我对此进行了大量研究,但只找到了有关旧的 discord.py 的线索,意思是await bot.add_react(emoji)- 但据我所知,这 不再有效!

这是我的代码:

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 = …
Run Code Online (Sandbox Code Playgroud)

python python-3.x discord.py discord.py-rewrite

5
推荐指数
1
解决办法
2万
查看次数