Module: IRC::RFC2812

Includes:
Constants
Defined in:
lib/irc/rfc2812/whois.rb,
lib/irc/rfc2812/prefix.rb,
lib/irc/rfc2812/message.rb,
lib/irc/rfc2812/helpers.rb,
lib/irc/rfc2812/replies.rb,
lib/irc/rfc2812/commands.rb,
lib/irc/rfc2812/constants.rb

Defined Under Namespace

Modules: Commands, Constants, Helpers Classes: Message, Prefix, Whois

Constant Summary collapse

REPLIES =

Public: A Hash that matches commands with all possible replies. The key is a command Symbol, the value a Hash with the following keys:

:start - A Symbol, indicating the start of the reply. :end - An Array of Symbol, indicating the end of a reply. :replies - An Array of Symbols, indicating a reply. :errors - An Array of Symbol, indicating an error.

They values for these keys may also be `nil`.

{
  :pass => {
    :errors  => [ERR_NEEDMOREPARAMS, ERR_ALREADYREGISTRED]
  },
  :nick => {
    :errors  => [ERR_NONICKNAMEGIVEN, ERR_ERRONEUSNICKNAME, 
                 ERR_NICKNAMEINUSE, ERR_NICKCOLLISION, 
                 ERR_UNAVAILRESOURCE, ERR_RESTRICTED]
  },
  :user => {
    :errors  => [ERR_NEEDMOREPARAMS, ERR_ALREADYREGISTRED]
  },
  :oper => {
    :replies => [RPL_YOUREOPER], 
    :errors  => [ERR_NEEDMOREPARAMS, ERR_NOOPERHOST, ERR_PASSWDMISMATCH]
  },
  :user_mode => {
    :replies => [:mode, RPL_UMODEIS],
    :errors  => [ERR_NEEDMOREPARAMS, ERR_USERSDONTMATCH, 
                 ERR_UMODEUNKNOWNFLAG]
  },
  :service => {
    :replies => [RPL_YOURESERVICE, RPL_YOURHOST, RPL_MYINFO],
    :errors  => [ERR_ALREADYREGISTRED, ERR_NEEDMOREPARAMS, 
                 ERR_ERRONEUSNICKNAME]
  },
  :squit => {
    :errors =>  [ERR_NOPRIVILEGES, ERR_NOSUCHSERVER, ERR_NEEDMOREPARAMS]
  },


  :join => {
    :replies => [:join, RPL_TOPIC],
    :errors  => [ERR_NEEDMOREPARAMS, ERR_BANNEDFROMCHAN, 
                 ERR_INVITEONLYCHAN, ERR_BADCHANNELKEY, ERR_CHANNELISFULL,
                 ERR_BADCHANMASK, ERR_NOSUCHCHANNEL, ERR_TOOMANYCHANNELS, 
                 ERR_TOOMANYTARGETS, ERR_UNAVAILRESOURCE]
  },
  :part => {
    :replies => [:part],
    :errors  => [ERR_NEEDMOREPARAMS, ERR_NOSUCHCHANNEL, ERR_NOTONCHANNEL]
  },
  :channel_mode => {
    :end     => [RPL_ENDOFBANLIST, RPL_ENDOFEXCEPTLIST, 
                 RPL_ENDOFINVITELIST],
    :replies => [:mode, RPL_CHANNELMODEIS, RPL_BANLIST, RPL_EXCEPTLIST, 
                 RPL_INVITELIST, RPL_UNIQOPIS],
    :errors  => [ERR_NEEDMOREPARAMS, ERR_KEYSET, ERR_NOCHANMODES, 
                 ERR_CHANOPRIVSNEEDED, ERR_USERNOTINCHANNEL,
                 ERR_UNKNOWNMODE]
  },
  :topic => {
    :replies => [:topic, RPL_NOTOPIC, RPL_TOPIC],
    :errors  => [ERR_NEEDMOREPARAMS, ERR_NOTONCHANNEL, 
                 ERR_CHANOPRIVSNEEDED, ERR_NOCHANMODES]
  },
  :names => {
    :end     => [RPL_ENDOFNAMES],
    :replies => [RPL_NAMREPLY],
    :errors  => [ERR_TOOMANYMATCHES, ERR_NOSUCHSERVER]
  },
  :list => {
    :end     => [RPL_LISTEND],
    :replies => [RPL_LIST],
    :errors  => [ERR_TOOMANYMATCHES, ERR_NOSUCHSERVER]
  },
  :invite => {
    :replies => [RPL_INVITING, RPL_AWAY],
    :errors  => [ERR_NEEDMOREPARAMS, ERR_NOSUCHNICK, ERR_NOTONCHANNEL,
                 ERR_USERONCHANNEL, ERR_CHANOPRIVSNEEDED] 
  },
  :kick => {
    :replies => [:kick],
    :errors  => [ERR_NEEDMOREPARAMS, ERR_NOSUCHCHANNEL, ERR_BADCHANMASK,
                 ERR_CHANOPRIVSNEEDED, ERR_USERNOTINCHANNEL,
                 ERR_NOTONCHANNEL]
  },
  :privmsg => {
    :replies => [:privmsg, RPL_AWAY],
    :errors  => [ERR_NORECIPIENT, ERR_NOTEXTTOSEND, ERR_CANNOTSENDTOCHAN,
                 ERR_NOTOPLEVEL, ERR_WILDTOPLEVEL, ERR_TOOMANYTARGETS, 
                 ERR_NOSUCHNICK]
  },
  :notice => {
    :replies => [:notice, RPL_AWAY],
    :errors  => [ERR_NORECIPIENT, ERR_NOTEXTTOSEND, ERR_CANNOTSENDTOCHAN,
                 ERR_NOTOPLEVEL, ERR_WILDTOPLEVEL, ERR_TOOMANYTARGETS, 
                 ERR_NOSUCHNICK]
  },


  :motd => {
    :start   => [RPL_MOTDSTART],
    :end     => [RPL_ENDOFMOTD],
    :replies => [RPL_MOTD],
    :errors  => [ERR_NOMOTD]                               
  },
  :lusers => {
    :replies => [RPL_LUSERCLIENT, RPL_LUSEROP, RPL_LUSERUNKNOWN,
                 RPL_LUSERCHANNELS, RPL_LUSERME],
    :errors  => [ERR_NOSUCHSERVER]
  },
  :version => {
    :replies => [RPL_VERSION],
    :errors  => [ERR_NOSUCHSERVER]
  },
  :stats => {
    :end     => [RPL_ENDOFSTATS],
    :replies => [RPL_STATSLINKINFO, RPL_STATSUPTIME, RPL_STATSCOMMANDS,
                 RPL_STATSOLINE],
    :errors  => [ERR_NOSUCHSERVER]         
  },
  :links => {
    :end     => [RPL_ENDOFLINKS],
    :replies => [RPL_LINKS],
    :errors  => [ERR_NOSUCHSERVER]
  },
  :time => {
    :replies => [RPL_TIME],
    :errors  => [ERR_NOSUCHSERVER]
  },
  :connect => {
    :errors  => [ERR_NOSUCHSERVER, ERR_NOPRIVILEGES, ERR_NEEDMOREPARAMS]
  },
  :trace => {
    :end     => [RPL_TRACEEND],
    :replies => [RPL_TRACECONNECTING, RPL_TRACEHANDSHAKE, 
                 RPL_TRACEUNKNOWN, RPL_TRACEOPERATOR, RPL_TRACEUSER, 
                 RPL_TRACESERVER,  RPL_TRACESERVICE, RPL_TRACENEWTYPE, 
                 RPL_TRACECLASS, RPL_TRACELOG]
  },
  :admin => {
    :replies => [RPL_ADMINME, RPL_ADMINLOC1, RPL_ADMINLOC2, 
                 RPL_ADMINEMAIL],
    :errors  => [ERR_NOSUCHSERVER]
  },
  :info => {
    :end     => [RPL_ENDOFINFO],
    :replies => [RPL_INFO],
    :errors  => [ERR_NOSUCHSERVER]
  },
  :servlist => {
    :end     => [RPL_SERVLISTEND],
    :replies => [RPL_SERVLIST]
  },
  :squery => {
    :replies  => [RPL_AWAY],
    :errors   => [ERR_NORECIPIENT, ERR_NOTEXTTOSEND, ERR_CANNOTSENDTOCHAN,
                  ERR_NOTOPLEVEL, ERR_WILDTOPLEVEL, ERR_TOOMANYTARGETS, 
                  ERR_NOSUCHNICK]
  },
  

  :who => {
    :end     => [RPL_ENDOFWHO],
    :replies => [RPL_WHOREPLY],
    :errors  => [ERR_NOSUCHSERVER]
  },
  :whois => {
    :end     => [RPL_ENDOFWHOIS],
    :replies => [RPL_WHOISUSER, RPL_WHOISCHANNELS, RPL_WHOISCHANNELS, 
                 RPL_WHOISSERVER, RPL_AWAY, RPL_WHOISOPERATOR,
                 RPL_WHOISIDLE],
    :errors  => [ERR_NOSUCHSERVER, ERR_NONICKNAMEGIVEN, ERR_NOSUCHNICK]              
  },
  :whowas => {
    :end     => [RPL_ENDOFWHOWAS],
    :replies => [RPL_WHOWASUSER, RPL_WHOISSERVER],
    :errors  => [ERR_NONICKNAMEGIVEN, ERR_WASNOSUCHNICK]
  },


  :kill => {
    :errors  => [ERR_NOPRIVILEGES, ERR_NEEDMOREPARAMS, ERR_NOSUCHNICK,
                ERR_CANTKILLSERVER]
  },
  :ping => {
    :errors  => [ERR_NOORIGIN, ERR_NOSUCHSERVER]
  },
  :pong => {
    :errors  => [ERR_NOORIGIN, ERR_NOSUCHSERVER]
  },


  :away => {
    :replies => [RPL_UNAWAY, RPL_NOWAWAY]
  },
  :rehash => {
    :replies => [RPL_REHASHING],
    :errors  => [ERR_NOPRIVILEGES]
  },
  :die => {
    :errors => [ERR_NOPRIVILEGES]
  },
  :restart => {
    :errors => [ERR_NOPRIVILEGES]
  },
  :summon => {
    :replies => [RPL_SUMMONING],
    :errors  => [ERR_NORECIPIENT, ERR_FILEERROR, ERR_NOLOGIN, 
                 ERR_NOSUCHSERVER, ERR_SUMMONDISABLED]
  },
  :users => {
    :replies => [RPL_USERSSTART,RPL_USERS, RPL_NOUSERS, RPL_ENDOFUSERS],
    :errors  => [ERR_NOSUCHSERVER, ERR_FILEERROR, ERR_USERSDISABLED]  
  },
  :wallops => {
    :errors  => [ERR_NEEDMOREPARAMS]
  },
  :userhost => {
    :replies => [RPL_USERHOST],
    :errors  => [ERR_NEEDMOREPARAMS]
  },
  :ison => {
    :replies => [RPL_ISON],
    :errors  => [ERR_NEEDMOREPARAMS]
  }
}

Constants included from Constants

Constants::ERR_ALREADYREGISTRED, Constants::ERR_BADCHANMASK, Constants::ERR_BADCHANNELKEY, Constants::ERR_BADMASK, Constants::ERR_BANLISTFULL, Constants::ERR_BANNEDFROMCHAN, Constants::ERR_CANNOTSENDTOCHAN, Constants::ERR_CANTKILLSERVER, Constants::ERR_CHANNELISFULL, Constants::ERR_CHANOPRIVSNEEDED, Constants::ERR_ERRONEUSNICKNAME, Constants::ERR_FILEERROR, Constants::ERR_INVITEONLYCHAN, Constants::ERR_KEYSET, Constants::ERR_NEEDMOREPARAMS, Constants::ERR_NICKCOLLISION, Constants::ERR_NICKNAMEINUSE, Constants::ERR_NOADMININFO, Constants::ERR_NOCHANMODES, Constants::ERR_NOLOGIN, Constants::ERR_NOMOTD, Constants::ERR_NONICKNAMEGIVEN, Constants::ERR_NOOPERHOST, Constants::ERR_NOORIGIN, Constants::ERR_NOPERMFORHOST, Constants::ERR_NOPRIVILEGES, Constants::ERR_NORECIPIENT, Constants::ERR_NOSERVICEHOST, Constants::ERR_NOSUCHCHANNEL, Constants::ERR_NOSUCHNICK, Constants::ERR_NOSUCHSERVER, Constants::ERR_NOSUCHSERVICE, Constants::ERR_NOTEXTTOSEND, Constants::ERR_NOTONCHANNEL, Constants::ERR_NOTOPLEVEL, Constants::ERR_NOTREGISTERED, Constants::ERR_PASSWDMISMATCH, Constants::ERR_RESTRICTED, Constants::ERR_SUMMONDISABLED, Constants::ERR_TOOMANYCHANNELS, Constants::ERR_TOOMANYMATCHES, Constants::ERR_TOOMANYTARGETS, Constants::ERR_UMODEUNKNOWNFLAG, Constants::ERR_UNAVAILRESOURCE, Constants::ERR_UNIQOPPRIVSNEEDED, Constants::ERR_UNKNOWNCOMMAND, Constants::ERR_UNKNOWNMODE, Constants::ERR_USERNOTINCHANNEL, Constants::ERR_USERONCHANNEL, Constants::ERR_USERSDISABLED, Constants::ERR_USERSDONTMATCH, Constants::ERR_WASNOSUCHNICK, Constants::ERR_WILDTOPLEVEL, Constants::ERR_YOUREBANNEDCREEP, Constants::ERR_YOUWILLBEBANNED, Constants::RPL_ADMINEMAIL, Constants::RPL_ADMINLOC1, Constants::RPL_ADMINLOC2, Constants::RPL_ADMINME, Constants::RPL_AWAY, Constants::RPL_BANLIST, Constants::RPL_BOUNCE, Constants::RPL_CHANNELMODEIS, Constants::RPL_CLOSEEND, Constants::RPL_CLOSING, Constants::RPL_CREATED, Constants::RPL_ENDOFBANLIST, Constants::RPL_ENDOFEXCEPTLIST, Constants::RPL_ENDOFINFO, Constants::RPL_ENDOFINVITELIST, Constants::RPL_ENDOFLINKS, Constants::RPL_ENDOFMOTD, Constants::RPL_ENDOFNAMES, Constants::RPL_ENDOFSERVICES, Constants::RPL_ENDOFSTATS, Constants::RPL_ENDOFUSERS, Constants::RPL_ENDOFWHO, Constants::RPL_ENDOFWHOIS, Constants::RPL_ENDOFWHOWAS, Constants::RPL_EXCEPTLIST, Constants::RPL_INFO, Constants::RPL_INFOSTART, Constants::RPL_INVITELIST, Constants::RPL_INVITING, Constants::RPL_ISON, Constants::RPL_KILLDONE, Constants::RPL_LINKS, Constants::RPL_LIST, Constants::RPL_LISTEND, Constants::RPL_LISTSTART, Constants::RPL_LUSERCHANNELS, Constants::RPL_LUSERCLIENT, Constants::RPL_LUSERME, Constants::RPL_LUSEROP, Constants::RPL_LUSERUNKNOWN, Constants::RPL_MOTD, Constants::RPL_MOTDSTART, Constants::RPL_MYINFO, Constants::RPL_MYPORTIS, Constants::RPL_NAMREPLY, Constants::RPL_NONE, Constants::RPL_NOTOPIC, Constants::RPL_NOUSERS, Constants::RPL_NOWAWAY, Constants::RPL_REHASHING, Constants::RPL_SERVICE, Constants::RPL_SERVICEINFO, Constants::RPL_SERVLIST, Constants::RPL_SERVLISTEND, Constants::RPL_STATSBLINE, Constants::RPL_STATSCLINE, Constants::RPL_STATSCOMMANDS, Constants::RPL_STATSDLINE, Constants::RPL_STATSHLINE, Constants::RPL_STATSILINE, Constants::RPL_STATSKLINE, Constants::RPL_STATSLINKINFO, Constants::RPL_STATSLLINE, Constants::RPL_STATSNLINE, Constants::RPL_STATSOLINE, Constants::RPL_STATSPING, Constants::RPL_STATSQLINE, Constants::RPL_STATSSLINE, Constants::RPL_STATSUPTIME, Constants::RPL_STATSVLINE, Constants::RPL_STATSYLINE, Constants::RPL_SUMMONING, Constants::RPL_TIME, Constants::RPL_TOPIC, Constants::RPL_TRACECLASS, Constants::RPL_TRACECONNECTING, Constants::RPL_TRACEEND, Constants::RPL_TRACEHANDSHAKE, Constants::RPL_TRACELINK, Constants::RPL_TRACELOG, Constants::RPL_TRACENEWTYPE, Constants::RPL_TRACEOPERATOR, Constants::RPL_TRACERECONNECT, Constants::RPL_TRACESERVER, Constants::RPL_TRACESERVICE, Constants::RPL_TRACEUNKNOWN, Constants::RPL_TRACEUSER, Constants::RPL_TRYAGAIN, Constants::RPL_UMODEIS, Constants::RPL_UNAWAY, Constants::RPL_UNIQOPIS, Constants::RPL_USERHOST, Constants::RPL_USERS, Constants::RPL_USERSSTART, Constants::RPL_VERSION, Constants::RPL_WELCOME, Constants::RPL_WHOISCHANNELS, Constants::RPL_WHOISCHANOP, Constants::RPL_WHOISIDLE, Constants::RPL_WHOISOPERATOR, Constants::RPL_WHOISSERVER, Constants::RPL_WHOISUSER, Constants::RPL_WHOREPLY, Constants::RPL_WHOWASUSER, Constants::RPL_YOUREOPER, Constants::RPL_YOURESERVICE, Constants::RPL_YOURHOST