I have a command that I want to restrict only to certain ranks. I’m using unreal3.2.6 IRC.
I read this: 
But I still am not sure what I can do to check the users rank.
I want to see if the user is a “Voice” or higher. What could look up a user, and what can I do to check if they are a voice or higher? What are the values for each rank in order for me to check?
I’m only trying to check the current channel, not the whole IRC server.
For example:
When a user tries to execute a command !roll (Rolls a dice) and are not a Voice or higher, nothing would happen.
if (data.Equals("!roll"))
{
//Check if user contains (@,+,etc?)
if(nickname.StartsWith(@..+..etc))
{
roll(nickname);
}
}
Instead of querying the user with a
WHOIScommand, you need to query the applicable channel with theNAMEScommand.From RFC 2812 – Internet Relay Chat: Client Protocol:
Quering a channel with the
NAMEScommand will yield these two replies:as well as:
You can split the list of nicks on the whitespace character, and determine whether the first character of a nick is a mode identifier (
+,@, etc..) or an alphanumeric character (which implies that the user has no special mode on the channel.)The IRC standard only defines
+as a voiced user and@as a channel operator, but other servers can be known to use special characters like~for channel owner and&for "super" channel operators. As a general rule, you could simply check to see that the user has any channel mode (other than the default) to verify that they’re voiced or better.