Beispiel #1
0
        public SimpleTwitchClient(Settings settings, OrtoBot ortoBot)
        {
            this.ortoBot  = ortoBot;
            this.settings = settings;

            ConnectionCredentials credentials = new ConnectionCredentials(settings.botUsername, settings.botOauth);

            Initialize(credentials, settings.botJoinChannel);

            AddChatCommandIdentifier('!');
            OnChatCommandReceived += ProcessReceivedChatCommand;
            //OnBeingHosted += ProcessIncomingHost; // Hosting events only work if broadcaster
            OnRaidNotification += ProcessIncomingRaid;

            Connect();
            Log.Information($"Twitch client connected!");
        }
Beispiel #2
0
        private static void Setup()
        {
            PrintWelcome();

            if (settings.debug)
            {
                Log.Information("DEBUG: " + settings.debug.ToString().ToUpper());
            }

            ortoBot = new OrtoBot(settings);

            ConnectNanoleaf();

            //await ConnectDiscord();

            ConnectTwitch();

            Log.Information("");
        }
Beispiel #3
0
        public SimpleTwitchPubSub(Settings settings, OrtoBot ortoBot)
        {
            OnPubSubServiceConnected += (sender, e) => SendTopics(settings.oauth);
            OnChannelSubscription    += (object sender, OnChannelSubscriptionArgs args) => ortoBot.HandleSubscription(args);
            OnFollow       += (object sender, OnFollowArgs args) => ortoBot.HandleFollowerAsync(args);
            OnBitsReceived += async(object sender, OnBitsReceivedArgs args) => await ortoBot.HandleReceivedBitsAsync(args);

            OnListenResponse += onListenResponse;

            /*OnStreamUp += onStreamUp;
             * OnStreamDown += onStreamDown;*/

            ListenToFollows(settings.channelId);
            ListenToBitsEvents(settings.channelId);
            //ListenToVideoPlayback(settings.channelName);
            ListenToSubscriptions(settings.channelId);

            Connect();
            Log.Information($"Twitch PubSub connected!");
        }
Beispiel #4
0
 public FakeTwitchClient(Settings settings, OrtoBot ortoBot) : base(settings, ortoBot)
 {
 }