예제 #1
0
        //private static async Task ConnectDiscord()
        //{
        //    Log.Information("Setting up Discord client..." +
        //        $"({settings.discord_token})");
        //    SimpleDiscordSocketClient discordClient = new SimpleDiscordSocketClient(settings);
        //    await discordClient.Initialize(settings.discord_token);
        //    ortoBot.SetDiscordClient(discordClient);
        //}

        private static void ConnectTwitch()
        {
            Log.Information("Setting up Twitch client..." +
                            $"({settings.botUsername}, {settings.botOauth}, {settings.botJoinChannel})");
            SimpleTwitchClient twitchClient;

            if (settings.botJoinChannel == "")
            {
                twitchClient = new FakeTwitchClient(settings, ortoBot);
            }
            else
            {
                twitchClient = new SimpleTwitchClient(settings, ortoBot);
            }
            ortoBot.SetTwitchClient(twitchClient);

            if (settings.channelId != "" && settings.oauth != "")
            {
                Log.Information("Connecting to Twitch PubSub... " +
                                $"({settings.channelId}, {settings.oauth})");
                SimpleTwitchPubSub twitchPubSub = new SimpleTwitchPubSub(settings, ortoBot);
                ortoBot.SetTwitchPubSub(twitchPubSub);
            }
        }
예제 #2
0
 internal void SetTwitchPubSub(SimpleTwitchPubSub twitchPubSub)
 {
     this.twitchPubSub = twitchPubSub;
 }