Ops: $nick(#channel,0,o)
Voices: $nick(#channel,0,v)
Regulars: $nick(#channel,0,r)
This is all in the help file, /help $nick
Note that the information that $nick() uses is only available after the raw 266 has been retrieved when you join a channel.
In other words, you cannot use that code in an on join event.
To message something to a channel check out the help file at /help /msg