Thanks for this bahiense, just one question how do I change this to work on all chans? I tried changing msg #CHANNEL to msg $chan but it didn't work.