【发布时间】:2021-12-27 00:46:59
【问题描述】:
我正在编写一个不和谐的机器人,功能 user.bot 不能正常工作
@client.event
async on_reaction_add(reaction, user):
if not user.bot:
await client.wait_until_ready()
try:
channel = client.get_channel(welcome_channel_id)
try:
await channel.send(message)
await reaction.remove(user)
except Exception as e
raise e
except Exception as e
raise e
一切正常都接受 if 语句,我创建了一条带有机器人反应的消息,但机器人的反应被删除了。 我正在使用 Python 3.8。如果你需要任何额外的信息,请告诉我。
【问题讨论】:
-
reaction.remove()听起来确实像是消除反应的东西,对吧? -
是的,但如果机器人做出反应,它仍然不应该这样做,这就是为什么会有
if not user.bot:
标签: python discord.py python-3.8