Код: Выделить всё
@client.event
async def on_ready():
channel = client.get_channel() #set channel to #rules
if isinstance(channel, discord.TextChannel):
text = "Please read the #rules and react for verification."
emoji = await channel.send(text)
await emoji.add_reaction('✅')
#When reaction
@client.event
async def on_reaction_add(reaction, author):
channel = client.get_channel() #Update channel as redundancy
if reaction.message.channel is not None and channel:
return
if reaction.emoji == "✅":
author = reaction.author
role = await reaction.author.guild.get_role()
await author.add_roles(role) #Checks for correct reaction and adds role
reaction.message.delete()
Чтение истории сообщений
Создание выражений
Создание реакций
Модерация участников
Управление ролями
Создание сообщений
Я также пробовал использовать user.guild.roles
иauthor.guild.roles для назначения.
Подробнее здесь: https://stackoverflow.com/questions/791 ... te-the-rol
Мобильная версия