$chan (remote)
From Scriptwiki
Returns the name of the channel for a specific event. For all non-channel events $chan will be $null.
$chan
It takes no parameters.
on *:text:hello:#mIRC:{ msg $chan $nick hello, and welcome to $chan $+ ! }
You can also use # to evaluate channel name. Ex:
welcome to $chan welcome to #
would return to same value.