import asyncio
import sqlite3
from discord import channel
from discord.ext import commands
from discord.utils import get
import discord
conn = sqlite3.connect('aern.db')
TOKEN = 'token'
bot = commands.Bot(command_prefix='/')
client = commands.Bot
@bot.command(pass_context=True)
async def poll(ctx, *, text):
message = await ctx.send(text)
for emoji in ('🤡', '💩'):
await message.add_reaction(emoji)
async def on_raw_reaction_add(payload):
if payload.message_id == config.POST_ID:
channel = client.get_channel(payload.channel_id) #канал
message = await channel.fetch_message(payload.message_id) #сообщение
user = get(message.guild.members, id=payload.user_id) #пользователь, который поставил реакцию
emoji = str(payload.emoji)
if __name__ == '__main__':
bot.run(TOKEN)
on_raw_reaction_add(payload)
- никак не срабатывает, т.е бот не реагирует на события