Это не рабочий обработчик событий
@bot.event
async def event_join(channel, user):
await channel.send(f'Привет, {user.name}! Добро пожаловать в чат!')
Это код всего бота
from twitchio.ext import commands
import cfg.cfg as cfg
# Подключаемся к Twitch API
bot = commands.Bot(
token=cfg.twitch_token,
client_id=cfg.your_client_id,
nick = "Botik",
prefix = '!',
initial_channels=['drunk_master_1']
)
welcome_message = 'Hello and welcome to the chat, {}!'
# event handler for when a user joins the chat
@bot.event
async def event_join(channel, user):
await channel.send(f'Привет, {user.name}! Добро пожаловать в чат!')
@bot.command(name='hello')
async def hello(ctx):`введите сюда код`
await ctx.send(f'Hello, {ctx.author.name}!')
# Запускаем бота
bot.run()