import { ChatClient } from "@twurple/chat" ; import { createAuthProvider , TwitchServiceConfig } from "nodecg-io-twitch-auth" ; export class TwitchChatServiceClient extends ChatClient { /**
     * Creates a instance of TwitchServiceClient using the credentials from the passed config.
     */ static async createClient ( cfg ) { const authProvider = await createAuthProvider ( cfg ) ; const chatClient = new TwitchChatServiceClient ( { authProvider } ) ; await chatClient . connect ( ) ; await new Promise ( ( resolve , _reject ) => { chatClient . onRegister ( ( ) => resolve ( undefined ) ) ; } ) ; return chatClient ; } param channel join ( channel ) { this . onRegister ( ( ) => { this . join ( channel ) ; } ) ; return super . join ( channel ) ; } }