我有一个问题,我不知道该怎么做.
基本上,我有一个机器人,如果他检测到一个词,它就会发送消息. 现在,我想添加根据添加react 的人修改该消息的可能性(机器人在发送的每条消息中添加3个react ).
到目前为止,它工作正常,我的机器人响应并添加了3个react ,但现在我不明白如何让我的机器人编辑他的消息(我甚至不能让机器人说谁点击了一个react ),同时也删除了react .
我已经阅读了文档,阅读了很多论坛,但我找不到一种方法来让它发挥作用…… 请帮帮忙=)
blue = '<:blue:1033370324135333898>'
red = '<:red:1033370379663704148>'
yellow = '<:yellow:1033370423078952970>'
@client.event
async def on_message(message):
if 'ping' in message.content.lower():
if message.channel.id == 1032275628470308895:
channel = client.get_channel(1032275628470308895)
react = await channel.send('pong!')
await react.add_reaction(blue)
await react.add_reaction(red)
await react.add_reaction(yellow)
@client.event
async def on_raw_reaction_add(payload):
# and then I don't know what to do, everything I've tried doesn't work
# I wanted to modify the message to (for example "{user} said blue pong!" and remove the reaction the user just use, and just keep the 3 from the bot)
# And then if another user use the yellow reaction, the bot modify his message to for example "{user] said yellow pong!"
# That could be great if the message was edited but keeping what was said before (in that case "pong! \n{user} said blue pong! \n{user} said yellow pong!")
# And last thing, if possible I want the bot to remove all reactions including his after 30mins