import discord
from discord.ext import commands
intents = discord.Intents.default()
intents.reactions = True
bot = commands.Bot(command_prefix='!', intents=intents)
@bot.event
async def on_ready():
print('Бот готов к работе')
@bot.event
async def on_raw_reaction_add(payload):
# Проверяем, что реакция добавлена к сообщению на нужном канале
if payload.channel_id == YOUR_CHANNEL_ID and payload.message_id == YOUR_MESSAGE_ID:
guild = bot.get_guild(payload.guild_id)
member = guild.get_member(payload.user_id)
role = discord.utils.get(guild.roles, name="Название вашей роли")
if role is not None:
await member.add_roles(role)
print(f"Роль {role.name} назначена для {member.name}")
# Запуск бота
bot.run('YOUR_BOT_TOKEN')