-1

I'm trying to finish off the twitch iRC Bot i did a year ago, but never did because of this i asking for help on this, and yes i know i can't have more than 2 parameters but atleast help thanks, i need the "msg" parameter to send a message.

         public void SendMsgBtn(object sender,EventArgs e, OnJoinedChannelArgs msg)
        {
            if (client.IsConnected)
            {
                
                client.SendMessage(msg.Channel,textBox1.Text);
            }
            textBox1.Clear();
        }

this.button6.Click += new System.EventHandler(this.SendMsgBtn);

  • You can't arbitrarily add parameters to an event like Click. Store what you need in a private variable, so you can use them (later) in a button's Click event handler. While you're at it, be sure to set the button's Enabled property so the user can't click it when no channel has been joined yet. – Hans Passant May 03 '21 at 11:27

1 Answers1

0

use this code:

this.button6.Click+=SendMsgBtn;