Files
lilacbot-twitch/src/modules/yarn/component.py
T

21 lines
582 B
Python

import asyncio
import twitchio
from twitchio import PartialUser, Scopes, eventsub
from twitchio.ext import commands as cmds
from meta import Bot, Context
from . import logger
class YarnComponent(cmds.Component):
def __init__(self, bot: Bot):
self.bot = bot
@cmds.Component.listener()
async def event_custom_redemption_add(self, payload: twitchio.ChannelPointsRedemptionAdd):
logger.info(f"Yarn got {payload!r}")
if payload.reward.title == 'pet lilac':
await payload.broadcaster.send_message("lilac PETPET", sender="1097964183")