我有这个奇怪的问题,我阅读了所有关于反应的文档,但是我的代码没有被调用!
@client.event
async def on_reaction_add(reaction, user):
print('reaction added')
上面的代码没有被调用!?!?此外,当我使用 on_raw_reaction_add
时它没有区别!?我已经尝试了我能想到的一切,我已经在我的齿轮中运行了它:
@Cog.listener()
async def on_raw_reaction_add(self, reaction, user):
print("detected")
@Cog.listener()
async def on_reaction_add(self, reaction, user):
print("detected")
它永远不起作用!?!?!?我知道除非您使用 raw,否则机器人在开始之前不会检测到反应!但我两个都试过!请帮忙,我也知道您需要意图,并且它们都已正确设置:
intents = discord.Intents(messages=True, guilds=True, members=True)
key2=os.getenv('key2')
key=os.getenv('key')
wkey=os.getenv('wkey')
client = discord.Client()#declaring what the client is.
client = commands.Bot(command_prefix = ';', intents=intents)#Makes the bot prefix.
老实说,我被困在如何解决这个问题上!