private static void ClientUsers(object sender, OnUserStateChangedArgs e) { TwitchChatForm.Instance.Invoke(new Action(() => { TwitchChatForm.Instance.listBox1.Items.Add(e.UserState.DisplayName); })); }
/// <summary> /// Invokes the user state changed. /// </summary> /// <param name="client">The client.</param> /// <param name="badges">The badges.</param> /// <param name="colorHex">The color hexadecimal.</param> /// <param name="displayName">The display name.</param> /// <param name="emoteSet">The emote set.</param> /// <param name="channel">The channel.</param> /// <param name="isSubscriber">if set to <c>true</c> [is subscriber].</param> /// <param name="isModerator">if set to <c>true</c> [is moderator].</param> /// <param name="userType">Type of the user.</param> public static void InvokeUserStateChanged(this TwitchClient client, List <KeyValuePair <string, string> > badges, List <KeyValuePair <string, string> > badgeInfo, string colorHex, string displayName, string emoteSet, string channel, bool isSubscriber, bool isModerator, UserType userType) { OnUserStateChangedArgs model = new OnUserStateChangedArgs() { UserState = new UserState(badges, badgeInfo, colorHex, displayName, emoteSet, channel, isSubscriber, isModerator, userType) }; client.RaiseEvent("OnUserStateChanged", model); }
private void Client_OnUserStateChanged(object?sender, OnUserStateChangedArgs e) { if (e.UserState.IsModerator || e.UserState.Channel.ToLower() == client.TwitchUsername.ToLower()) { return; } owner.MissingPermissions(e.UserState.Channel); ManualDisconnect = true; client.Disconnect(); }
private void onUserStateChanged(object sender, OnUserStateChangedArgs e) { MessageBox.Show($"Display Name: {e.UserState.DisplayName}\nSubscriber: {e.UserState.Subscriber}\nModerator: {e.UserState.Moderator}"); }
/// <summary> /// Passes <see cref="OnUserStateChanged"/> events down to subscribed plugins. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">An <see cref="OnUserStateChangedArgs"/> object.</param> private void TwitchClient_OnUserStateChanged(object sender, OnUserStateChangedArgs e) => this.OnUserStateChanged?.Invoke(this, e);
private void _client_OnUserStateChanged(object sender, OnUserStateChangedArgs e) { }