The easy to use and full featured Irc Bot everyone is talking about!
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

MessageTypes.cs 7.4KB

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