That's because there's no channel associated with a socket event. You should store the channel information somewhere so it can be associated with the socket and retrieved when you need it. A simple way to do this is with the sockmark command.

Code:
alias tvrage { 
  unset %tvrage*
  unset %tv.*
  unset %show*
  %tvrage = $replace($1,$chr(46),% $+ 20)
  %tv.rel = $replace($1,$chr(46),$chr(32))
  set %tv.release $2
  set %tv.section $3
  sockopen tvrage http://www.tvrage.com 80
  sockmark tvrage $chan
}


Then use $sock($sockname).mark in your socket events to retrieve the channel name.


Spelling mistakes, grammatical errors, and stupid comments are intentional.