The easy to use and full featured Irc Bot everyone is talking about!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

MessageTypes.cs 7.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  1. using System;
  2. using System.Collections.Generic;
  3. namespace Combot.IRCServices.Messaging
  4. {
  5. abstract public class IMessage : EventArgs
  6. {
  7. public DateTime TimeStamp { get; set; }
  8. public IMessage()
  9. {
  10. TimeStamp = DateTime.Now;
  11. }
  12. }
  13. abstract public class IReply : IMessage
  14. {
  15. public string Message { get; set; }
  16. }
  17. public class ServerReplyMessage : IReply
  18. {
  19. public IRCReplyCode ReplyCode { get; set; }
  20. }
  21. public class ServerErrorMessage : IReply
  22. {
  23. public IRCErrorCode ErrorCode { get; set; }
  24. }
  25. public class ErrorMessage : IMessage
  26. {
  27. public string Message { get; set; }
  28. }
  29. public class ChannelMessage : IMessage
  30. {
  31. public string Channel { get; set; }
  32. public Nick Sender { get; set; }
  33. public string Message { get; set; }
  34. }
  35. public class PrivateMessage : IMessage
  36. {
  37. public Nick Sender { get; set; }
  38. public string Message { get; set; }
  39. }
  40. public class ServerNotice : IMessage
  41. {
  42. public string Message { get; set; }
  43. }
  44. public class ChannelNotice : IMessage
  45. {
  46. public string Channel { get; set; }
  47. public Nick Sender { get; set; }
  48. public string Message { get; set; }
  49. }
  50. public class PrivateNotice : IMessage
  51. {
  52. public Nick Sender { get; set; }
  53. public string Message { get; set; }
  54. }
  55. public class CTCPMessage : IMessage
  56. {
  57. public string Location { get; set; }
  58. public Nick Sender { get; set; }
  59. public string Command { get; set; }
  60. public string Arguments { get; set; }
  61. }
  62. public class TopicChangeInfo : IMessage
  63. {
  64. public string Channel { get; set; }
  65. public Nick Nick { get; set; }
  66. public string Topic { get; set; }
  67. }
  68. public class ChannelModeChangeInfo : IMessage
  69. {
  70. public string Channel { get; set; }
  71. public Nick Nick { get; set; }
  72. public List<ChannelModeInfo> Modes { get; set; }
  73. }
  74. public class UserModeChangeInfo : IMessage
  75. {
  76. public Nick Nick { get; set; }
  77. public List<UserModeInfo> Modes { get; set; }
  78. }
  79. public class NickChangeInfo : IMessage
  80. {
  81. public Nick OldNick { get; set; }
  82. public Nick NewNick { get; set; }
  83. }
  84. public class InviteChannelInfo : IMessage
  85. {
  86. public string Channel { get; set; }
  87. public Nick Requester { get; set; }
  88. public Nick Recipient { get; set; }
  89. }
  90. public class JoinChannelInfo : IMessage
  91. {
  92. public string Channel { get; set; }
  93. public Nick Nick { get; set; }
  94. }
  95. public class PartChannelInfo : IMessage
  96. {
  97. public string Channel { get; set; }
  98. public Nick Nick { get; set; }
  99. }
  100. public class KickInfo : IMessage
  101. {
  102. public string Channel { get; set; }
  103. public Nick Nick { get; set; }
  104. public Nick KickedNick { get; set; }
  105. public string Reason { get; set; }
  106. }
  107. public class QuitInfo : IMessage
  108. {
  109. public Nick Nick { get; set; }
  110. public string Message { get; set; }
  111. }
  112. public class PingInfo : IMessage
  113. {
  114. public string Message { get; set; }
  115. }
  116. public class PongInfo : IMessage
  117. {
  118. public string Message { get; set; }
  119. }
  120. // IRC Reply Codes //
  121. public enum IRCReplyCode
  122. {
  123. RPL_WELCOME = 1,
  124. RPL_YOURHOST = 2,
  125. RPL_CREATED = 3,
  126. RPL_MYINFO = 4,
  127. RPL_BOUNCE = 5,
  128. RPL_TRACELINK = 200,
  129. RPL_TRACECONNECTING = 201,
  130. RPL_TRACEHANDSHAKE = 202,
  131. RPL_TRACEUNKNOWN = 203,
  132. RPL_TRACEOPERATOR = 204,
  133. RPL_TRACEUSER = 205,
  134. RPL_TRACESERVER = 206,
  135. RPL_TRACESERVICE = 207,
  136. RPL_TRACENEWTYPE = 208,
  137. RPL_TRACECLASS = 209,
  138. RPL_TRACERECONNECT = 210,
  139. RPL_STATSLINKINFO = 211,
  140. RPL_STATSCOMMANDS = 212,
  141. RPL_ENDOFSTATS = 219,
  142. RPL_UMODEIS = 221,
  143. RPL_SERVLIST = 234,
  144. RPL_SERVLISTEND = 235,
  145. RPL_STATSUPTIME = 242,
  146. RPL_STATSOLINE = 243,
  147. RPL_LUSERCLIENT = 251,
  148. RPL_LUSEROP = 252,
  149. RPL_LUSERUNKNOWN = 253,
  150. RPL_LUSERCHANNELS = 254,
  151. RPL_LUSERME = 255,
  152. RPL_ADMINME = 256,
  153. RPL_ADMINLOC1 = 257,
  154. RPL_ADMINLOC2 = 258,
  155. RPL_ADMINEMAIL = 259,
  156. RPL_TRACELOG = 261,
  157. RPL_TRACEEND = 262,
  158. RPL_TRYAGAIN = 263,
  159. RPL_AWAY = 301,
  160. RPL_USERHOST = 302,
  161. RPL_ISON = 303,
  162. RPL_UNAWAY = 305,
  163. RPL_NOWAWAY = 306,
  164. RPL_WHOISUSER = 311,
  165. RPL_WHOISSERVER = 312,
  166. RPL_WHOISOPERATOR = 313,
  167. RPL_WHOWASUSER = 314,
  168. RPL_ENDOFWHO = 315,
  169. RPL_WHOISIDLE = 317,
  170. RPL_ENDOFWHOIS = 318,
  171. RPL_WHOISCHANNELS = 319,
  172. RPL_LISTSTART = 321,
  173. RPL_LIST = 322,
  174. RPL_LISTEND = 323,
  175. RPL_CHANNELMODEIS = 324,
  176. RPL_UNIQOPIS = 325,
  177. RPL_NOTOPIC = 331,
  178. RPL_TOPIC = 332,
  179. RPL_INVITING = 341,
  180. RPL_SUMMONING = 342,
  181. RPL_INVITELIST = 346,
  182. RPL_ENDOFINVITELIST = 347,
  183. RPL_EXCEPTLIST = 348,
  184. RPL_ENDOFEXCEPTLIST = 349,
  185. RPL_VERSION = 351,
  186. RPL_WHOREPLY = 352,
  187. RPL_NAMREPLY = 353,
  188. RPL_LINKS = 364,
  189. RPL_ENDOFLINKS = 365,
  190. RPL_ENDOFNAMES = 366,
  191. RPL_BANLIST = 367,
  192. RPL_ENDOFBANLIST = 368,
  193. RPL_ENDOFWHOWAS = 369,
  194. RPL_INFO = 371,
  195. RPL_MOTD = 372,
  196. RPL_ENDOFINFO = 374,
  197. RPL_MOTDSTART = 375,
  198. RPL_ENDOFMOTD = 376,
  199. RPL_YOUREOPER = 381,
  200. RPL_REHASHING = 382,
  201. RPL_YOURESERVICE = 383,
  202. RPL_TIME = 391,
  203. RPL_USERSSTART = 392,
  204. RPL_USERS = 393,
  205. RPL_ENDOFUSERS = 394,
  206. RPL_NOUSERS = 395
  207. }
  208. // IRC Error Codes //
  209. public enum IRCErrorCode
  210. {
  211. ERR_NOSUCHNICK = 401,
  212. ERR_NOSUCHSERVER = 402,
  213. ERR_NOSUCHCHANNEL = 403,
  214. ERR_CANNOTSENDTOCHAN = 404,
  215. ERR_TOOMANYCHANNELS = 405,
  216. ERR_WASNOSUCHNICK = 406,
  217. ERR_TOOMANYTARGETS = 407,
  218. ERR_NOSUCHSERVICE = 408,
  219. ERR_NOORIGIN = 409,
  220. ERR_NORECIPIENT = 411,
  221. ERR_NOTEXTTOSEND = 412,
  222. ERR_NOTOPLEVEL = 413,
  223. ERR_WILDTOPLEVEL = 414,
  224. ERR_BADMASK = 415,
  225. ERR_UNKNOWNCOMMAND = 421,
  226. ERR_NOMOTD = 422,
  227. ERR_NOADMININFO = 423,
  228. ERR_FILEERROR = 424,
  229. ERR_NONICKNAMEGIVEN = 431,
  230. ERR_ERRONEUSNICKNAME = 432,
  231. ERR_NICKNAMEINUSE = 433,
  232. ERR_NICKCOLLISION = 436,
  233. ERR_UNAVAILRESOURCE = 437,
  234. ERR_USERNOTINCHANNEL = 441,
  235. ERR_NOTONCHANNEL = 442,
  236. ERR_USERONCHANNEL = 443,
  237. ERR_NOLOGIN = 444,
  238. ERR_SUMMONDISABLED = 445,
  239. ERR_USERSDISABLED = 446,
  240. ERR_NOTREGISTERED = 451,
  241. ERR_NEEDMOREPARAMS = 461,
  242. ERR_ALREADYREGISTRED = 462,
  243. ERR_NOPERMFORHOST = 463,
  244. ERR_PASSWDMISMATCH = 464,
  245. ERR_YOUREBANNEDCREEP = 465,
  246. ERR_YOUWILLBEBANNED = 466,
  247. ERR_KEYSET = 467,
  248. ERR_CHANNELISFULL = 471,
  249. ERR_UNKNOWNMODE = 472,
  250. ERR_INVITEONLYCHAN = 473,
  251. ERR_BANNEDFROMCHAN = 474,
  252. ERR_BADCHANNELKEY = 475,
  253. ERR_BADCHANMASK = 476,
  254. ERR_NOCHANMODES = 477,
  255. ERR_BANLISTFULL = 478,
  256. ERR_NOPRIVILEGES = 481,
  257. ERR_CHANOPRIVSNEEDED = 482,
  258. ERR_CANTKILLSERVER = 483,
  259. ERR_RESTRICTED = 484,
  260. ERR_UNIQOPPRIVSNEEDED = 485,
  261. ERR_NOOPERHOST = 491,
  262. ERR_UMODEUNKNOWNFLAG = 501,
  263. ERR_USERSDONTMATCH = 502
  264. }
  265. }