Example #1
0
 private static void PubSub_OnListenResponse(object sender, OnListenResponseArgs e)
 {
     if (!e.Successful)
     {
         BotTools.LogLine($"Failed to listen! Response: {e.Response.Error}");
     }
 }
Example #2
0
 private void onListenResponse(object sender, OnListenResponseArgs e)
 {
     if (!e.Successful)
     {
         Console.WriteLine($"Failed to listen! Response: {e.Response.Error}");
     }
 }
Example #3
0
 private static void onListenResponse(object sender, OnListenResponseArgs e)
 {
     if (!e.Successful)
     {
         throw new Exception($"Failed to listen! Response: {e.Response}");
     }
 }
Example #4
0
 private void OnListenResponse(object sender, OnListenResponseArgs e)
 {
     if (!e.Successful)
     {
         _logger.Error($"Failed to listen! Response{e.Response}");
     }
 }
Example #5
0
 private static void onListenResponse(object sender, OnListenResponseArgs e)
 {
     if (!e.Successful)
     {
         throw new Exception($"Failed to listen! Response: {e.Response.Error}");
     }
     Console.WriteLine($"Listening to {e.Topic}", Color.Green);
 }
Example #6
0
 private void onListenResponse(object sender, OnListenResponseArgs e)
 {
     Debug.WriteLine($"[Listener] {e.Topic} => {e.Response}");
     if (!e.Successful)
     {
         throw new Exception($"Failed to listen! Response: {e.Response}");
     }
 }
        /// <summary>
        /// Makes sure we were able to listen to a response then passes <see cref="OnListenResponse"/> events down to subscribed plugins.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">An <see cref="OnListenResponseArgs"/> object.</param>
        private void TwitchPubSub_OnListenResponse(object sender, OnListenResponseArgs e)
        {
            OnListenResponse?.Invoke(this, e);

            if (!e.Successful)
            {
                // TODO: Handle error/response.
            }
        }
Example #8
0
        private async void OnListenResponse(object sender, OnListenResponseArgs e)
        {
            Utils.LogToConsole($"Listen response | success: {e.Successful} | topic: {e.Topic} | response: {e.Response.Error}");

            if (!e.Successful)
            {
                await Utils.SendDiscordErrorWebhookAsync($"{_config["DiscordWebhookUserPing"]} Error in OnListenResponse", _config["DiscordWebhookUrl"]);
            }
        }
 //Give feedback if connected sucessfully or failed
 private void Pubsub_OnListenResponse(object sender, OnListenResponseArgs e)
 {
     if (!e.Successful)
     {
         throw new Exception($"Failed to listen! Response: {e.Topic}");
     }
     else
     {
         Console.WriteLine("Connected to PubSub");
     }
 }
Example #10
0
 private void onListenResponse(object?sender, OnListenResponseArgs args)
 {
     if (args.Successful == false)
     {
         _Logger.LogWarning($"FAIL {args.Topic}: {args.Response.Error}");
     }
     else
     {
         _Logger.LogDebug($"SUCCESS {args.Topic}: {args.Response.Nonce}");
     }
 }
Example #11
0
 private void Client_OnListenResponse(object sender, OnListenResponseArgs e)
 {
     if (!e.Successful)
     {
         logger.LogError("Unable to listen to pubsub for " + token.UserName + ": " + e.Response.Error);
     }
     else
     {
         logger.LogDebug("PubSub " + e.Topic + " Successefull for " + token.UserName);
     }
 }
Example #12
0
 private void PubSub_OnListenResponse(object sender, OnListenResponseArgs e)
 {
     if (e.Successful)
     {
         Console.WriteLine("Listening to " + e.Topic + " successfully!");
     }
     else
     {
         Console.WriteLine("Couldn't start listening to " + e.Topic + "...");
     }
 }
        private void _pubSubClient_OnListenResponse(object sender, OnListenResponseArgs e)
        {
            System.Diagnostics.Debug.WriteLine("Response from topic:" + e.Topic);
            System.Diagnostics.Debug.WriteLine("Nonce: " + e.Response.Nonce);

            if (!e.Successful)
            {
                System.Diagnostics.Debug.WriteLine("Successful: " + e.Response.Successful);
                System.Diagnostics.Debug.WriteLine("Error: " + e.Response.Error);
            }
        }
Example #14
0
 public static void OnListenResponse(object sender, OnListenResponseArgs e)
 {
     if (e.Successful)
     {
         Console.WriteLine($"Successfully verified listening to topic: {e.Topic}");
     }
     else
     {
         Console.WriteLine($"Failed to listen! Error: {e.Response.Error}");
     }
 }
Example #15
0
 private void OnListenResponse(object sender, OnListenResponseArgs e)
 {
     if (e.Successful)
     {
         Logger.LogRewardInfo("{0} : Success".Format(e.Topic));
     }
     else
     {
         Logger.LogRewardInfo("{0} : {1}".Format(e.Topic, e.Response.Error));
     }
 }
Example #16
0
 private void pubsubOnListenResponse(object sender, OnListenResponseArgs e)
 {
     if (e.Successful)
     {
         MessageBox.Show($"Successfully verified listening to topic: {e.Topic}");
     }
     else
     {
         MessageBox.Show($"Failed to listen! Error: {e.Response.Error}");
     }
 }
Example #17
0
 private void _pubSub_OnListenResponse(object sender, OnListenResponseArgs e)
 {
     if (!e.Successful)
     {
         PushNewMessage($"Failed to listen! Response: {e.Response.Error}");
     }
     else
     {
         PushNewMessage($"Success! Listening to topic: {e.Topic}");
     }
 }
Example #18
0
 private void OnListenResponse(object sender, OnListenResponseArgs e)
 {
     if (e.Successful)
     {
         _logger.LogInformation($"Successfully verified listening to topic: {e.Topic}");
     }
     else
     {
         _logger.LogError($"OnListenResponse - Failed to listen! {e.Topic} - Error: {e.Response.Error}");
     }
 }
Example #19
0
 public static void onListenResponse(object sender, OnListenResponseArgs e)
 {
     if (e.Successful)
     {
         UI.Instance.toggleConnected(true);
     }
     else
     {
         Common.PubSub.Disconnect();
         MessageBox.Show("Either the provided OAuth was invalid or the provided moderator username was not actually a moderator on the channel provided.");
         Helpers.LaunchLogin();
     }
 }
Example #20
0
 private void PubSub_OnListenResponse(object sender, OnListenResponseArgs e)
 {
     if (e.Successful)
     {
         consoleMessage[3] = "Listening to topic:";
         consoleMessage[5] = e.Topic;
         Program.SendToConsole(consoleMessage);
     }
     else
     {
         consoleMessage[3] = $"Failed to listen to {e.Topic}";
         consoleMessage[5] = e.Response.Error;
         Program.SendToConsole(consoleMessage);
     }
 }
Example #21
0
        /// <summary>
        /// NuJuan Verified
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <returns></returns>
        private async void OnListenResponse(object sender, OnListenResponseArgs e)
        {
            BotChannel bChan = await Program.Channels.GetTwitchChannelByName(_twitchChannelName);

            if (!e.Successful)
            {
                await Core.LOG(new LogEntry(LOGSEVERITY.INFO, EXTENSIONNAME,
                                            $"Failed to listen to {e.Topic}! Response: {e.Response.Error}"
                                            ));

                if (bChan != null)
                {
                    if (bChan.discordAdminChannel != 0)
                    {
                        await(Program.DiscordClient.GetChannel(bChan.discordAdminChannel) as ISocketMessageChannel).SendMessageAsync(
                            $"Failed to listen to {e.Topic}. Response: {e.Response.Error}"
                            );
                    }
                }
            }
            else
            {
                await Core.LOG(new LogEntry(LOGSEVERITY.INFO, EXTENSIONNAME,
                                            $"Listening to {e.Topic} for {_twitchChannelName}."
                                            ));

                if (_verbose)
                {
                    if (bChan.discordAdminChannel != 0)
                    {
                        // This line crashed once F**k knows how or why
                        await(Program.DiscordClient.GetChannel(bChan.discordAdminChannel) as ISocketMessageChannel).SendMessageAsync(
                            $"Listening to {e.Topic}."
                            );
                    }
                }
            }
        }
Example #22
0
        private void OnListenResponse(object sender, OnListenResponseArgs e)
        {
            string successful = e.Successful ? "Successful" : "Unsuccessful";

            form.WriteChat($"{DateTime.Now.ToLocalTime()}: PubSub: {e.Topic}: {successful}", false);
        }
Example #23
0
 private void onListenResponse(object sender, OnListenResponseArgs e)
 {
     Console.Out.WriteLine(e.Successful
         ? $"Successfully verified listening to topic: {e.Topic}"
         : $"Failed to listen! Error: {e.Response.Error}");
 }