private void TwitchClient_OnMessageSent(object sender, OnMessageSentArgs e) { if (_twitchClient.IsConnected) { _twitchClient.Disconnect(); } }
private void OnBotMessageSent(object sender, OnMessageSentArgs e) { StyleSheet styleSheet = new StyleSheet(Color.White); styleSheet.AddStyle(e.SentMessage.DisplayName, ColorTranslator.FromHtml(e.SentMessage.ColorHex)); ConsoleHelper.WriteLineStyled($"[{DateTime.Now.ToString("T")}] {e.SentMessage.DisplayName}: {e.SentMessage.Message}", styleSheet); }
private void OnMessageSent(object sender, OnMessageSentArgs e) { string formatted = $"[{DateTime.Now.ToString("H:mm:ss")}] {client.TwitchUsername}: {e.SentMessage.Message}"; if (textBoxChat.Text != "") { Invoke(new Action(() => { textBoxChat.Text += Environment.NewLine; })); } Invoke(new Action(() => { textBoxChat.Text += formatted; })); }
private void Client_OnMessageSent(object sender, OnMessageSentArgs e) { consoleMessage[1] = "#"; consoleMessage[3] = e.SentMessage.DisplayName; consoleMessage[4] = e.SentMessage.Channel; consoleMessage[5] = e.SentMessage.Message; //string message = $"[{DateTime.Now.ToString("MM/dd - HH:mm")} | Twitch.#{e.SentMessage.Channel}<<] {e.SentMessage.DisplayName}: {e.SentMessage.Message}"; Program.SendToConsole(consoleMessage, true); }
private void Client_OnMessageSent(object sender, OnMessageSentArgs e) { if (!PrintLog) { return; } Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine($"#{e.SentMessage.Channel,-11} | {Settings.Username} {e.SentMessage.Message}"); Console.ForegroundColor = ConsoleColor.White; }
/// <summary> /// When bot sends a message. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void TwitchClient_OnMessageSent(Object sender, OnMessageSentArgs e) { // Avoid infinite recursion. if (e.SentMessage.Message.StartsWith('.')) { return; } ChangeColor(); }
/// <summary> /// Invokes the message sent. /// </summary> /// <param name="client">The client.</param> /// <param name="badges">The badges.</param> /// <param name="channel">The channel.</param> /// <param name="colorHex">The color hexadecimal.</param> /// <param name="displayName">The display name.</param> /// <param name="emoteSet">The emote set.</param> /// <param name="isModerator">if set to <c>true</c> [is moderator].</param> /// <param name="isSubscriber">if set to <c>true</c> [is subscriber].</param> /// <param name="userType">Type of the user.</param> /// <param name="message">The message.</param> public static void InvokeMessageSent(this TwitchClient client, List <KeyValuePair <string, string> > badges, string channel, string colorHex, string displayName, string emoteSet, bool isModerator, bool isSubscriber, UserType userType, string message) { OnMessageSentArgs model = new OnMessageSentArgs() { SentMessage = new SentMessage(badges, channel, colorHex, displayName, emoteSet, isModerator, isSubscriber, userType, message) }; client.RaiseEvent("OnMessageSent", model); }
public void ShouldIgnoreCommands() { var args = new OnMessageSentArgs() { SentMessage = SentMessageBuilder .Create() .WithMessage('.' + Message) .Build() }; Sut.TwitchClient_OnMessageSent(null, args); MockedTwitchClientManager .Verify(x => x.SpoolMessage(PrimaryChannelName, It.IsAny <String>(), Priority.Medium), Times.Never()); }
public void ShouldSetColorFromColorSelector() { var args = new OnMessageSentArgs() { SentMessage = SentMessageBuilder .Create() .WithMessage(Message) .Build() }; Sut.TwitchClient_OnMessageSent(null, args); MockedTwitchClientManager .Verify(x => x.SpoolMessage(PrimaryChannelName, $".color {Color1}", Priority.Medium), Times.Once()); }
private void OnMessageSent(object sender, OnMessageSentArgs e) { string states = ""; string ChatM = ""; string content = ""; DispName = states + e.SentMessage.DisplayName; ChatM = e.SentMessage.Message; NameColor = e.SentMessage.ColorHex; if (e.SentMessage.IsSubscriber) { states += "<img src=\"" + GetBadges(C_ID, "subscriber") + "\"> "; } if (e.SentMessage.UserType.ToString() == "Admin") { states += "<img src=\"" + GetBadges(C_ID, "admin") + "\"> "; } if (e.SentMessage.IsModerator) { states += "<img src=\"" + GetBadges(C_ID, "mod") + "\"> "; } if (e.SentMessage.UserType.ToString() == "Broadcaster") { states += "<img src=\"" + GetBadges(C_ID, "broadcaster") + "\"> "; } content = "<div><span style=\"color:" + NameColor + "; font-family:Arial,Helvetica,sans-serif; font-size:10pt;\"><strong>" + DispName.ToString() + ": </strong></span><span style=\"font-family:Arial,Helvetica,sans-serif; font-size:10pt;\">" + ChatM + "</span></div>"; if (webChat.InvokeRequired) { Action act = () => this.webChat.Document.Body.InnerHtml += content; webChat.Invoke(act); act = () => ScrollToBottom(); webChat.Invoke(act); } else { this.webChat.DocumentText += content; } }
private void _client_OnMessageSent(object sender, OnMessageSentArgs e) { }
private async void Client_OnMessageSent(object sender, OnMessageSentArgs e) { await _eventProxy.PublishAsync(new TwitchMessageSentNotification(this, e.SentMessage)) .ConfigureAwait(false); }
private void Client_OnMessageSent(object sender, OnMessageSentArgs e) { Console.WriteLine($"{Config.Instance.ChannelName} >>> {e.SentMessage.Message}"); }
private void OnMessageSent(object sender, OnMessageSentArgs e) { Debug.Log(e.SentMessage.Message); }
private void OnBotMessageSent(object sender, OnMessageSentArgs e) { ConsoleHelper.WriteLineChat($"{e.SentMessage.DisplayName}: {e.SentMessage.Message}"); }
void OnMessageSent(object sender, OnMessageSentArgs e) { Debug.Log(e.SentMessage.Channel + ": " + e.SentMessage.DisplayName + ": " + e.SentMessage.Message); }
private void OnMessageSent(object sender, OnMessageSentArgs e) { Debug.Log("<color=blue> MSG: " + e.SentMessage.DisplayName + "--" + e.SentMessage.Message + "</color>"); }
/// <summary> /// Passes <see cref="OnMessageSent"/> events down to subscribed plugins. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">An <see cref="OnMessageSentArgs"/> object.</param> private void TwitchClient_OnMessageSent(object sender, OnMessageSentArgs e) => this.OnMessageSent?.Invoke(this, e);
private void Client_OnMessageSent(object sender, OnMessageSentArgs e) { logService.Add($"{e.SentMessage.DisplayName}: {e.SentMessage.Message}", MessageType.Type.EVENT, MethodBase.GetCurrentMethod().DeclaringType); }
private void onMessageSent(object sender, OnMessageSentArgs e) { richTextBox1.Text += $"\n[via onMessageSent] [Me]{e.SentMessage.DisplayName} [mod: {e.SentMessage.IsModerator}] [sub: {e.SentMessage.IsSubscriber}]: {e.SentMessage.Message}"; }
private void Client_OnMessageSent(object sender, OnMessageSentArgs e) { Log.Information("Message sent: {message}", e.SentMessage.Message); }
/// <summary> /// Called when the Twitch bot has sent a chat message. /// </summary> private static void Client_OnMessageSent(object sender, OnMessageSentArgs e) { Console.WriteLine($"[{e.SentMessage.Channel}] {e.SentMessage.DisplayName} has sent a message: {e.SentMessage.Message}"); }
private void OnMessageSent(object sender, OnMessageSentArgs e) { Debug.Log("<color=blue> MSG: " + e.SentMessage.DisplayName + "--" + e.SentMessage.Message + "</color>"); CreateChatLine(e.SentMessage.DisplayName, e.SentMessage.Message, e.SentMessage.ColorHex); }
private void Client_OnMessageSent(object sender, OnMessageSentArgs e) { this.Dispatcher.Invoke(() => Chat.Items.Insert(0, e.SentMessage.DisplayName.ToString() + " : " + e.SentMessage.Message.ToString())); this.Dispatcher.Invoke(() => controlListMemory()); }
private async void TwitchOnMessageSent(object sender, OnMessageSentArgs e) { await Program.BotEvents.RaiseOnTwitchMessageSent(e.SentMessage.Channel, e.SentMessage.Message); }
private void Client_OnMessageSent(object sender, OnMessageSentArgs e) { //Console.WriteLine("received message from {0}, chatting: {1}: ", e.ChatMessage.DisplayName, $" {SenderString}, {e.ChatMessage.DisplayName}"); }