Tried that thing, but didnt work

However I got it to work by putting the msg into the socketread and made a global variable for the current channel that I can put in there instead of msg $chan or msg #

Thank you