【发布时间】:2021-07-04 15:15:15
【问题描述】:
你好我的机器人我放了一个自动角色系统但是当我运行我的代码时它对我说:
NameError: name 'message' is not define
你能帮我吗? 代码:
@client.event
async def on_ready():
Channel = client.get_channel('829747866360610843')
Text= "Hey Si Tu Veux Acceder Au Conversations Exclusivement Pour Les Mangas Clique Sur La Réaction ???? !"
Moji = await message.channel.send(Channel, Text)
await client.add_reaction(Moji, emoji='????')
@client.event
async def on_reaction_add(reaction, user):
Channel = client.get_channel('829747866360610843')
if reaction.message.channel.id != Channel:
return
if user.reaction.emoji == "????":
Role = discord.utils.get(user.server.roles, name="manga")
await client.add_roles(user, Role)
【问题讨论】:
-
这个方法已经过时了,只能从另一个post复制过去。即使错误是不言自明的,也请给我们完整的回溯。
标签: discord.py