【发布时间】:2019-04-20 19:29:21
【问题描述】:
如何制作一个机器人,让人们在对特定事物做出反应时赋予他们角色?到目前为止我有这个,但它不起作用
@client.event
async def on_ready():
channel = client.get_channel('513546504481406979')
role = discord.utils.get(user.server.roles, name="testrole")
message = await bot.send_message(channel, "React to me!")
while True:
reaction = await bot.wait_for_reaction(emoji="????", message=message)
await bot.add_roles(reaction.message.author, role)
【问题讨论】:
标签: python discord discord.py