不和谐嵌入不分配角色的用户反应



我已经重新构建了大部分代码并做了更改。

当我做!嵌入一切都正常工作时,机器人创建嵌入,并与表情符号集反应,它只是不给用户角色,一旦他们对表情符号作出反应,机器人对帖子作出反应。

我决定在每个步骤中添加一些随机打印语句来击中控制台,并发现我可以看到在我的代码中注释的while True,但之后打印语句没有响应。

到目前为止,我的错误处理程序/跟踪已经很好了,并且拾取了所有东西,所以就像while True之后什么都不存在一样,我认为问题在于这一行:

reaction = await bot.wait_for("reaction_add", check=lambda reaction, user: user == reaction.message.id == msg.id)

任何帮助都将是非常感激的。

desc1 = ("React with the corresponding emoji to game specific channels you wantn"
"n👍 - Counter Striken"
"😀 - Warframen"
"🤓 - Lost Arkn"
"😆 - Chillern"
"💪 - Warhammer")
@bot.command()
async def embed(ctx: commands.Context):
embed=discord.Embed(title="Create Your Profile", description=(desc1))
embed.set_footer(text="Jammys Bot")
msg = await ctx.send(embed=embed)
await msg.add_reaction('👍')
await msg.add_reaction('😀')
await msg.add_reaction('🤓')
await msg.add_reaction('😆')
await msg.add_reaction('💪')
print('it works here')
while True:
print('it works here 1') ## makes it up to here. Error handle/trace back isn't picking anything below up so its like its non-existent.
reaction = await bot.wait_for("reaction_add", check=lambda reaction, user: user == reaction.message.id == msg.id) # stops working here
print('it works here 2')
if reaction.emoji == '👍':
print('it works here 3')
CSGO = ctx.guild.get_role(780182144747569193)
print('it works here 4')
await bot.add_roles(CSGO)
print('it works here 5')
if reaction.emoji == '😀':
WF = ctx.guild.get_role(780244861130768395)
await ctx.add_roles(WF)
if reaction.emoji == '🤓':
LA = ctx.guild.get_role(947231964753170473)
await bot.add_roles(LA)
if reaction.emoji == '😆':
CHILL = ctx.guild.get_role(896853904384458772)
await bot.add_roles(CHILL)
if reaction.emoji == '💪':
WH = ctx.guild.get_role(896882687816630293)
await bot.add_roles(WH)

要将其发送到特定频道,可以尝试使用以下代码

channel =client.get_channel(your channelid)
msg = await channel.send(embed = embed)

相关内容

  • 没有找到相关文章

最新更新