【发布时间】:2021-09-30 18:08:52
【问题描述】:
如果作者有角色,我想发送消息,但是如果我尝试此代码它不起作用(角色的 id 是正确的)。
@client.command()
async def role(ctx):
roles = ctx.author.roles
for x in roles:
if x.id == '850644250152665098':
await ctx.send("Role")
【问题讨论】:
-
ID 是整数,而不是字符串
标签: python discord discord.py roles