private void OnConnected(object sender, OnConnectedArgs e)
 {
     if (Config.TwitchChannel != "")
     {
         client.JoinChannel(Config.TwitchChannel);
     }
 }
Exemple #2
0
        private void TwitchClientConnected(object sender, OnConnectedArgs onConnectedArgs)
        {
            _isReady = true;
            _connectionCompletionTask.SetResult(true);

            _twitchClient.OnUserJoined += TwitchClientOnOnUserJoined;
        }
Exemple #3
0
 private async void Client_OnConnected(object sender, OnConnectedArgs e)
 {
     await MainWindow.Instance.ListBoxAnswers.Dispatcher.BeginInvoke(new Action(delegate()
     {
         MainWindow.Instance.ListBoxAnswers.Items.Add($"Connected to {e.AutoJoinChannel}");
     }));
 }
Exemple #4
0
        private void OnConnected(object sender, OnConnectedArgs e)
        {
            StatusArgs status = new StatusArgs();

            status.Status = StatusArgs.TwitchBotStatus.Connected;
            StatusEvent(this, status);
        }
Exemple #5
0
        private void Client_OnConnected(object sender, OnConnectedArgs e)
        {
            logService.Add($"{ e.AutoJoinChannel}", MessageType.Type.EVENT,
                           MethodBase.GetCurrentMethod().DeclaringType);

            // client.SendMessage(Startup.streamerName, "olyashHailmedoed olyashHailmedoed olyashHailmedoed");
        }
Exemple #6
0
        // Twitch events
        private async void OnConnected(object sender, OnConnectedArgs e)
        {
            if (api == null)
            {
                api = new TwitchAPI();
                api.Settings.ClientId    = config[3];
                api.Settings.AccessToken = config[2];
            }

            channelID = (await api.V5.Users.GetUserByNameAsync(config[1])).Matches.FirstOrDefault().Id;
            permitted = new List <string>();

            if (!Directory.Exists("files/" + channelID))
            {
                Directory.CreateDirectory("files/" + channelID);
                File.WriteAllText($"files/{channelID}/commands.txt", "");
            }
            commands = new Dictionary <string, string>();
            foreach (string line in File.ReadAllLines($"files/{channelID}/commands.txt"))
            {
                commands.Add(line.Split(new[] { ' ' }, 2)[0], line.Split(new[] { ' ' }, 2)[1]);
            }

            Invoke(new Action(() => { Log("Connected."); labelStatus.Text = "Console [Status: Online]"; }));
        }
Exemple #7
0
        private void OnConnected(object sender, OnConnectedArgs e)
        {
            messageBus.Send("twitch", "");
            BroadcastDiscordServer();

            logger.WriteDebug("Connected to Twitch IRC Server");
        }
        protected virtual void OnConnected(object sender, OnConnectedArgs args)
        {
            Task.Run(async() =>
            {
                try
                {
                    _isRunning = true;

                    if (_timer != null)
                    {
                        _timer.Dispose();
                    }

                    _timer = new Timer(OnTimerTick, null, 0, TwitchNETUtils.GetRateLimit());

                    await FireConnectionBotEventAsync(sender, new ConnectionBotEventArgs
                    {
                        Bot = this,
                        ConnectionEventType = ConnectionEventType.ConnectedToTwitch,
                    });
                }
                catch (Exception ex)
                {
                    await FireErrorEventAsync(sender, new ErrorBotConnectEventArgs
                    {
                        Bot = this,
                        ErrorConnectionEventType = ErrorConnectionEventType.ConnectBot,
                        Exception = ex
                    });

                    await DisconnectAsync();
                }
            });
        }
Exemple #9
0
        private void Client_OnConnected(object sender, OnConnectedArgs e)
        {
            Utilities.Log($"ClientConnected");
            QTChatManager.Instance.ToggleChat(true);

            this.timersManager?.StartTimers();
        }
Exemple #10
0
        private void TwitchClient_OnConnected(object sender, OnConnectedArgs e)
        {
            twitchClient.OnConnected -= TwitchClient_OnConnected;

            _clientConnectionCompletionTask.SetResult(true);
            _clientConnectionCompletionTask = new TaskCompletionSource <bool>();
        }
Exemple #11
0
 private void Client_OnConnected(object sender, OnConnectedArgs e)
 {
     foreach (var channel in client.JoinedChannels)
     {
         Logger.LogInfo("Connected to channel: {0}.".Format(channel?.Channel));
     }
 }
Exemple #12
0
        /// <summary>
        /// Resets the <see cref="_nextConnectAttemptBackoffKey"/> once a stable connection has been established for 30 seconds.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">An <see cref="OnConnectedArgs"/> object.</param>
        private async void TwitchClient_OnConnected(object sender, OnConnectedArgs e)
        {
            this.OnConnected?.Invoke(this, e);

            IMongoCollection <UserDocument> collection = DatabaseClient.Instance.MongoDatabase.GetCollection <UserDocument>(UserDocument.CollectionName);

            FilterDefinitionBuilder <UserDocument> builder = Builders <UserDocument> .Filter;

            FilterDefinition <UserDocument> filter = builder.Eq(d => d.ShouldJoin, true);

            using IAsyncCursor <string> cursor = await collection.FindAsync(filter, new FindOptions <UserDocument, string> { Projection = Builders <UserDocument> .Projection.Expression(d => d.Login) }).ConfigureAwait(false);

            List <string> channelsToJoin = await cursor.ToListAsync().ConfigureAwait(false);

            foreach (string channel in channelsToJoin)
            {
                this.JoinChannel(channel);
            }

            DateTime nextConnectAttempt = this._nextConnectAttempt;
            await Task.Delay(30000).ConfigureAwait(false);

            if (this.IsConnected && this._nextConnectAttempt.CompareTo(nextConnectAttempt) == 0)
            {
                this._nextConnectAttemptBackoffKey = 0;
            }
        }
Exemple #13
0
 public void OnConnected(object sender, OnConnectedArgs e)
 {
     //CheckForIllegalCrossThreadCalls = false;
     client.JoinChannel(Properties.Settings.Default.Username);
     AddChat("<< Connected to chat server >>");
     SetStatus("Connected to chat server");
 }
Exemple #14
0
 private void Client_OnConnected(object sender, OnConnectedArgs e)
 {
     foreach (var channel in this.channels)
     {
         this.client.JoinChannel(channel);
     }
 }
 private void onConnected(object sender, OnConnectedArgs e)
 {
     CheckForIllegalCrossThreadCalls = false;
     textBox_output_info.AppendText("Connected!" + Environment.NewLine);
     connection_status            = true;
     label_connection_status.Text = "connected";
     client.SendMessage(Properties.Settings.Default.channel, Properties.Settings.Default.hello_conn_msg);
 }
Exemple #16
0
        private void OnConnected(object sender, OnConnectedArgs e)
        {
            var botName = e?.BotUsername ?? "<unknown>";

            _connectionFailures = 0;
            _isReady            = true;
            WriteLine($"{botName} is connected to Twitch!");
        }
Exemple #17
0
 private void onConnected(object sender, OnConnectedArgs e)
 {
     Logger.Log("Twitch client connected.");
     foreach (string username in UserManager.GetTwitchUsernames())
     {
         this.JoinChannel(username);
     }
 }
 private void Client_OnConnected(object sender, OnConnectedArgs e)
 {
     if (Connected != null)
     {
         Connected(true);
     }
     Console.WriteLine("[Bot]: Connected successfully!");
 }
Exemple #19
0
        private void TwitchClientConnected(object sender, OnConnectedArgs onConnectedArgs)
        {
            _twitchClient.OnConnected -= TwitchClientConnected;

            _isReady = true;
            _connectionCompletionTask.SetResult(true);
            _disconnectionCompletionTask = new TaskCompletionSource <bool>();
            _twitchClient.SendMessage("Hello World! The bot has arrived!");
        }
Exemple #20
0
        private void TwitchClientConnected(object sender, OnConnectedArgs onConnectedArgs)
        {
            _logger.LogInformation($"{nameof(TwitchChatClient)} connected");
            _twitchClient.OnConnected -= TwitchClientConnected;

            _isReady = true;
            _connectionCompletionTask.SetResult(true);
            _disconnectionCompletionTask = new TaskCompletionSource <bool>();
        }
 private void client_OnConnected(object sender, OnConnectedArgs e)
 {
     if (e.Username.ToString() == name)
     {
         this.Dispatcher.Invoke(() => Chat.Items.Insert(0, "Client is connected to mIRC Server"));
         this.Dispatcher.Invoke(() => stateUserControl(true));
         this.Dispatcher.Invoke(() => controlListMemory());
     }
 }
Exemple #22
0
        private void TwitchClient_OnConnected(object sender, OnConnectedArgs e)
        {
            _twitchClient.OnConnected -= TwitchClient_OnConnected;

            OnConnected?.Invoke(this, null);

            _connectionCompletionTask.SetResult(true);
            _connectionCompletionTask = new TaskCompletionSource <bool>();
        }
Exemple #23
0
 private void Client_OnConnected(object sender, OnConnectedArgs e)
 {
     form.ExecuteAction(() =>
     {
         form.DebugRichTextBox.AppendText("[Bot]: Connected\n");
         form.ConnectChatBotButton.Enabled = false;
         form.ToggleButton.Enabled         = true;
     });
 }
Exemple #24
0
        private void TwitchClientOnConnected(object sender, OnConnectedArgs e)
        {
            _isReady = true;
            _twitchClient.OnConnected -= TwitchClientOnConnected;
            _connectionCompletionTask.SetResult(true);

            _disconnectionCompletionTask = new TaskCompletionSource <bool>();
            SendMessage("LipheBot has arrived!");
        }
Exemple #25
0
        private static void OnConnected(object sender, OnConnectedArgs e)
        {
            BNC_Core.Logger.Log($"{TwitchUsername} (BNC Bot) has connected to Twitch channel : {TwitchChannel}", LogLevel.Info);

            if (Config.ShowDebug())
            {
                sendMessage("Blessings and Curses has initialized a connection to Twitch!!!");
            }
        }
Exemple #26
0
        /// <summary>
        /// Invokes the connected.
        /// </summary>
        /// <param name="client">The client.</param>
        /// <param name="autoJoinChannel">The automatic join channel.</param>
        /// <param name="botUsername">The bot username.</param>
        public static void InvokeConnected(this TwitchClient client, string autoJoinChannel, string botUsername)
        {
            OnConnectedArgs model = new OnConnectedArgs()
            {
                AutoJoinChannel = autoJoinChannel,
                BotUsername     = botUsername
            };

            client.RaiseEvent("OnConnected", model);
        }
Exemple #27
0
 private void Client_OnConnected(object sender, OnConnectedArgs e)
 {
     Console.WriteLine($"Connected to {e.AutoJoinChannel}");
     client.JoinChannel(Settings.ChannelName);
     isConnected = true;
     window.Dispatcher.Invoke((Action)(() =>
     {//this refer to form in WPF application
         window.BotStarted();
     }));
 }
Exemple #28
0
        // Token: 0x06000023 RID: 35 RVA: 0x00003520 File Offset: 0x00001720
        private void SCMC(object sender, OnConnectedArgs e)
        {
            string msg = "";

            this.CustomMSGTXTBX.Dispatcher.Invoke(delegate()
            {
                msg = this.CustomMSGTXTBX.Text;
            });
            (sender as TwitchClient).SendMessage(msg, false);
        }
Exemple #29
0
        private void OnTwitchConnected(object sender, OnConnectedArgs e)
        {
            _logger.LogWarning("Connection established!");
            _logger.LogInformation("Joining initial channels");
            _configuration.GetSection("twitch:initialChannels").Get <List <string> >()
            .ForEach((channel => this.JoinChannel(channel)));
            _logger.LogInformation("Joined initial channels");

            _twitchInteractor = _twitchInteractorBuilder(_client);
        }
Exemple #30
0
        private void OnConnected(object sender, OnConnectedArgs e)
        {
            EvtConnectedArgs connectedArgs = new EvtConnectedArgs()
            {
                BotUsername     = e.BotUsername,
                AutoJoinChannel = e.AutoJoinChannel
            };

            OnConnectedEvent?.Invoke(connectedArgs);
        }
Exemple #31
0
 public void onConnected(object sender, OnConnectedArgs e)
 {
     MessageBox.Show("Connected under username: " + e.Username);
 }