events.py 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. # Numeric table based on the Perl's Net::IRC.
  2. numeric = {
  3. "001": "welcome",
  4. "002": "yourhost",
  5. "003": "created",
  6. "004": "myinfo",
  7. "005": "featurelist", # XXX
  8. "200": "tracelink",
  9. "201": "traceconnecting",
  10. "202": "tracehandshake",
  11. "203": "traceunknown",
  12. "204": "traceoperator",
  13. "205": "traceuser",
  14. "206": "traceserver",
  15. "207": "traceservice",
  16. "208": "tracenewtype",
  17. "209": "traceclass",
  18. "210": "tracereconnect",
  19. "211": "statslinkinfo",
  20. "212": "statscommands",
  21. "213": "statscline",
  22. "214": "statsnline",
  23. "215": "statsiline",
  24. "216": "statskline",
  25. "217": "statsqline",
  26. "218": "statsyline",
  27. "219": "endofstats",
  28. "221": "umodeis",
  29. "231": "serviceinfo",
  30. "232": "endofservices",
  31. "233": "service",
  32. "234": "servlist",
  33. "235": "servlistend",
  34. "241": "statslline",
  35. "242": "statsuptime",
  36. "243": "statsoline",
  37. "244": "statshline",
  38. "250": "luserconns",
  39. "251": "luserclient",
  40. "252": "luserop",
  41. "253": "luserunknown",
  42. "254": "luserchannels",
  43. "255": "luserme",
  44. "256": "adminme",
  45. "257": "adminloc1",
  46. "258": "adminloc2",
  47. "259": "adminemail",
  48. "261": "tracelog",
  49. "262": "endoftrace",
  50. "263": "tryagain",
  51. "265": "n_local",
  52. "266": "n_global",
  53. "300": "none",
  54. "301": "away",
  55. "302": "userhost",
  56. "303": "ison",
  57. "305": "unaway",
  58. "306": "nowaway",
  59. "311": "whoisuser",
  60. "312": "whoisserver",
  61. "313": "whoisoperator",
  62. "314": "whowasuser",
  63. "315": "endofwho",
  64. "316": "whoischanop",
  65. "317": "whoisidle",
  66. "318": "endofwhois",
  67. "319": "whoischannels",
  68. "321": "liststart",
  69. "322": "list",
  70. "323": "listend",
  71. "324": "channelmodeis",
  72. "329": "channelcreate",
  73. "330": "whoisaccount", # <nick> <accountName> :<info> - Spawned from a /whois
  74. "331": "notopic",
  75. "332": "currenttopic",
  76. "333": "topicinfo",
  77. "341": "inviting",
  78. "342": "summoning",
  79. "346": "invitelist",
  80. "347": "endofinvitelist",
  81. "348": "exceptlist",
  82. "349": "endofexceptlist",
  83. "351": "version",
  84. "352": "whoreply",
  85. "353": "namreply",
  86. "354": "whospcrpl", # Response to a WHOX query
  87. "361": "killdone",
  88. "362": "closing",
  89. "363": "closeend",
  90. "364": "links",
  91. "365": "endoflinks",
  92. "366": "endofnames",
  93. "367": "banlist",
  94. "368": "endofbanlist",
  95. "369": "endofwhowas",
  96. "371": "info",
  97. "372": "motd",
  98. "373": "infostart",
  99. "374": "endofinfo",
  100. "375": "motdstart",
  101. "376": "endofmotd",
  102. "377": "motd2", # 1997-10-16 -- tkil
  103. "381": "youreoper",
  104. "382": "rehashing",
  105. "384": "myportis",
  106. "391": "time",
  107. "392": "usersstart",
  108. "393": "users",
  109. "394": "endofusers",
  110. "395": "nousers",
  111. "401": "nosuchnick",
  112. "402": "nosuchserver",
  113. "403": "nosuchchannel",
  114. "404": "cannotsendtochan",
  115. "405": "toomanychannels",
  116. "406": "wasnosuchnick",
  117. "407": "toomanytargets",
  118. "409": "noorigin",
  119. "410": "invalidcapcmd",
  120. "411": "norecipient",
  121. "412": "notexttosend",
  122. "413": "notoplevel",
  123. "414": "wildtoplevel",
  124. "421": "unknowncommand",
  125. "422": "nomotd",
  126. "423": "noadmininfo",
  127. "424": "fileerror",
  128. "431": "nonicknamegiven",
  129. "432": "erroneusnickname", # Thiss iz how its speld in thee RFC.
  130. "433": "nicknameinuse",
  131. "436": "nickcollision",
  132. "437": "unavailresource", # "Nick temporally unavailable"
  133. "441": "usernotinchannel",
  134. "442": "notonchannel",
  135. "443": "useronchannel",
  136. "444": "nologin",
  137. "445": "summondisabled",
  138. "446": "usersdisabled",
  139. "451": "notregistered",
  140. "461": "needmoreparams",
  141. "462": "alreadyregistered",
  142. "463": "nopermforhost",
  143. "464": "passwdmismatch",
  144. "465": "yourebannedcreep", # I love this one...
  145. "466": "youwillbebanned",
  146. "467": "keyset",
  147. "471": "channelisfull",
  148. "472": "unknownmode",
  149. "473": "inviteonlychan",
  150. "474": "bannedfromchan",
  151. "475": "badchannelkey",
  152. "476": "badchanmask",
  153. "477": "nochanmodes", # "Channel doesn't support modes"
  154. "478": "banlistfull",
  155. "480": "cannotknock", #generated when /knock <chan> is ran on a channel that you are either in or has /knock'ing disabled
  156. "481": "noprivileges",
  157. "482": "chanoprivsneeded",
  158. "483": "cantkillserver",
  159. "484": "restricted", # Connection is restricted
  160. "485": "uniqopprivsneeded",
  161. "491": "nooperhost",
  162. "492": "noservicehost",
  163. "501": "umodeunknownflag",
  164. "502": "usersdontmatch",
  165. }
  166. codes = dict((v, k) for k, v in numeric.items())
  167. generated = [
  168. "dcc_connect",
  169. "dcc_disconnect",
  170. "dccmsg",
  171. "disconnect",
  172. "ctcp",
  173. "ctcpreply",
  174. ]
  175. protocol = [
  176. "error",
  177. "join",
  178. "kick",
  179. "mode",
  180. "part",
  181. "ping",
  182. "privmsg",
  183. "privnotice",
  184. "pubmsg",
  185. "pubnotice",
  186. "quit",
  187. "invite",
  188. "pong",
  189. "action",
  190. "topic",
  191. "nick",
  192. ]
  193. all = generated + protocol + list(numeric.values())