Python twitchAPI.eventsub - Notification when streamers go live

I’m trying to build a custom Discord bot and part of the functionality I’m working on is being able to set up notifications for when streamers go live. I have been looking for different methods and libraries and tried using this to little success

Below is my current code

from twitchAPI.twitch import Twitch
from twitchAPI import eventsub
import asyncio

class twitch_class:
    twitch = {}
    chat = {}
    app_id = ""
    app_secret = ""

    def __init__(self, app_id, app_secret) -> None:
        self.app_id = app_id
        self.app_secret = app_secret

    async def create_socket_connection(self):
        self.twitch = await Twitch(self.app_id, self.app_secret)
        hook = eventsub("MyIP:Port", self.app_id, Port, self.twitch)
        hook.listen_stream_online(Channel_ID, self.streamer_goes_live)
        #Lakea Channel ID - 
        #events = twitchAPI.eventsub(self.twitch)
        #eventsub.start() = await Chat(self.twitch)

    async def streamer_goes_live(self, data: dict):

If I could have some explanation to help then it would be appreciated, I have looked at the Twitch documentation but thought this library handled the requests for me.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.