private void button3_Click(object sender, EventArgs e) { ConnectionCredentials credentials = new ConnectionCredentials(ConnectionCredentials.ClientType.Whisper, new TwitchIpAndPort(true), textBox6.Text, textBox7.Text); TwitchWhisperClient newClient = new TwitchWhisperClient(credentials, '!'); newClient.OnWhisperReceived += new EventHandler <TwitchWhisperClient.OnWhisperReceivedArgs>(globalWhisperReceived); newClient.OnCommandReceived += new EventHandler <TwitchWhisperClient.OnCommandReceivedArgs>(whisperCommandReceived); newClient.OnIncorrectLogin += new EventHandler <TwitchWhisperClient.OnIncorrectLoginArgs>(incorrectWhisperLogin); newClient.OnConnected += new EventHandler <TwitchWhisperClient.OnConnectedArgs>(onWhisperConnected); newClient.Connect(); whisperClients.Add(newClient); ListViewItem lvi = new ListViewItem(); lvi.Text = textBox6.Text; lvi.SubItems.Add("WHISPER"); lvi.SubItems.Add("N/A"); listView1.Items.Add(lvi); comboBox1.Items.Add(textBox6.Text); }
public Bankbot(string ip, int port, string username, string password, string channelname) { this.ChatConnection = new TwitchChatClient(ip, port, username, password, channelname); this.ChatConnection.Start(); this.WhisperConnection = new TwitchWhisperClient(ip, port, username, password); //add triggers this.ChatConnection.OnMessageReceive += this.chatMessageTrigger; this.WhisperConnection.OnWhispereReceive += this.whisperMessageTrigger; //add commandhandlers (chat) this.ChatConnection.OnMessageReceive += this.printChatMessage; Twitch.Commands.CommandAbout commandAbout = new Twitch.Commands.CommandAbout(this, 10); Twitch.Commands.CommandBalance commandBalance = new Twitch.Commands.CommandBalance(this, 0); Twitch.Commands.CommandDebug commandDebug = new Twitch.Commands.CommandDebug(this, 0); Twitch.Commands.CommandDeposit commandDeposit = new Twitch.Commands.CommandDeposit(this, 10); Twitch.Commands.CommandWithdraw commadWithdraw = new Twitch.Commands.CommandWithdraw(this, 0); Twitch.Commands.CommandTestman commandTestman = new Twitch.Commands.CommandTestman(this, 0); //add commandhandlers (whisper) this.OnWhispereReceive += this.printWhisperMessage; }
private void whisperMessageTrigger(TwitchWhisperClient sender, WhisperMessage m) { this.OnWhispereReceive(this, m); }