The easy to use and full featured Irc Bot everyone is talking about!
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

IRCTypes.cs 9.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Collections;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using System.ComponentModel;
  8. using System.Net;
  9. namespace Combot
  10. {
  11. public enum ErrorType
  12. {
  13. Bot = 0,
  14. TCP = 1,
  15. IRC = 2,
  16. Framework = 3
  17. }
  18. public enum MessageType
  19. {
  20. Service = 0,
  21. Channel = 1,
  22. Query = 2,
  23. Notice = 3,
  24. CTCP = 4
  25. }
  26. public class ChannelModeInfo
  27. {
  28. public ChannelMode Mode { get; set; }
  29. public bool Set { get; set; }
  30. public string Parameter { get; set; }
  31. }
  32. public class UserModeInfo
  33. {
  34. public UserMode Mode { get; set; }
  35. public bool Set { get; set; }
  36. public string Parameter { get; set; }
  37. }
  38. public enum ChannelMode
  39. {
  40. [Description("Admin")]
  41. a,
  42. [Description("Admin Only")]
  43. A,
  44. [Description("Ban")]
  45. b,
  46. [Description("Colourless")]
  47. c,
  48. [Description("No CTCP")]
  49. C,
  50. [Description("Ban Exempt")]
  51. e,
  52. [Description("Flood Protection")]
  53. f,
  54. [Description("HalfOp")]
  55. h,
  56. [Description("Invite Only")]
  57. i,
  58. [Description("Invite Exempt")]
  59. I,
  60. [Description("Join Throttling")]
  61. j,
  62. [Description("Key")]
  63. k,
  64. [Description("No KNOCK")]
  65. K,
  66. [Description("Limit")]
  67. l,
  68. [Description("Link")]
  69. L,
  70. [Description("Moderated")]
  71. m,
  72. [Description("Registered Nicks May Talk")]
  73. M,
  74. [Description("No External Messages")]
  75. n,
  76. [Description("No Nickname Changes")]
  77. N,
  78. [Description("Operator")]
  79. o,
  80. [Description("Oper Only")]
  81. O,
  82. [Description("Private")]
  83. p,
  84. [Description("Owner")]
  85. q,
  86. [Description("No Kicks Allowed")]
  87. Q,
  88. [Description("Registered")]
  89. r,
  90. [Description("Registered Only")]
  91. R,
  92. [Description("Secret")]
  93. s,
  94. [Description("Strip Mirc Colors")]
  95. S,
  96. [Description("+hoaq Only Topic Change")]
  97. t,
  98. [Description("No Notices")]
  99. T,
  100. [Description("Auditorium")]
  101. u,
  102. [Description("Voice")]
  103. v,
  104. [Description("No Invite")]
  105. V,
  106. [Description("Secure Only")]
  107. z
  108. }
  109. public enum UserMode
  110. {
  111. [Description("Service Administrator")]
  112. a,
  113. [Description("Service Administrator")]
  114. A,
  115. [Description("Bot")]
  116. B,
  117. [Description("Connection Notice")]
  118. c,
  119. [Description("C-oAdministrator")]
  120. C,
  121. [Description("Deaf")]
  122. d,
  123. [Description("View 'Eyes' Server Messages")]
  124. e,
  125. [Description("Flood Alerts")]
  126. f,
  127. [Description("Remote Server Connection Notice")]
  128. F,
  129. [Description("GlobOp and LocOp Messages")]
  130. g,
  131. [Description("Censored")]
  132. G,
  133. [Description("Helpful")]
  134. h,
  135. [Description("Hide IRCop Status")]
  136. H,
  137. [Description("Invisible")]
  138. i,
  139. [Description("Junk Messages")]
  140. j,
  141. [Description("Kill Messages")]
  142. k,
  143. [Description("Nick Change Notice")]
  144. n,
  145. [Description("Network Administrator")]
  146. N,
  147. [Description("Global Operator")]
  148. o,
  149. [Description("Local Operator")]
  150. O,
  151. [Description("Hide All Channels")]
  152. p,
  153. [Description("U:Lines Only")]
  154. q,
  155. [Description("Registered")]
  156. r,
  157. [Description("Registered Messages Only")]
  158. R,
  159. [Description("Server Notices")]
  160. s,
  161. [Description("Services Only")]
  162. S,
  163. [Description("VHost")]
  164. t,
  165. [Description("No CTCP")]
  166. T,
  167. [Description("Receive Bad DCC")]
  168. v,
  169. [Description("WebTV User")]
  170. V,
  171. [Description("Wallops")]
  172. w,
  173. [Description("Whois Notice")]
  174. W,
  175. [Description("Hidden Hostname")]
  176. x,
  177. [Description("Secure Connection")]
  178. z
  179. }
  180. public enum ServerStat
  181. {
  182. [Description("List of Servers that allow Server Connection")]
  183. c,
  184. [Description("List of Server Hubs")]
  185. h,
  186. [Description("List of Hosts that allow Client Connection")]
  187. i,
  188. [Description("List of banned user/hostname of Server")]
  189. k,
  190. [Description("Lists Server Connections")]
  191. l,
  192. [Description("Commands Supported")]
  193. m,
  194. [Description("Lists Hosts that allow Normal Operators")]
  195. o,
  196. [Description("List Class lines from Server Config")]
  197. y,
  198. [Description("Server Uptime")]
  199. u
  200. }
  201. public class BotError
  202. {
  203. public ErrorType Type { get; set; }
  204. public string Message { get; set; }
  205. }
  206. public class Server
  207. {
  208. public string Name { get; set; }
  209. public List<IPEndPoint> Hosts { get; set; }
  210. public List<Channel> Channels { get; set; }
  211. public bool AutoConnect { get; set; }
  212. public Nick Nick { get; set; }
  213. }
  214. public class Message
  215. {
  216. public Server Server { get; set; }
  217. public Channel Channel { get; set; }
  218. public Nick Sender { get; set; }
  219. public Nick Recipient { get; set; }
  220. public string Parameters { get; set; }
  221. }
  222. // IRC Reply Codes //
  223. public enum IRCReplyCode
  224. {
  225. RPL_WELCOME = 1,
  226. RPL_YOURHOST = 2,
  227. RPL_CREATED = 3,
  228. RPL_MYINFO = 4,
  229. RPL_BOUNCE = 5,
  230. RPL_TRACELINK = 200,
  231. RPL_TRACECONNECTING = 201,
  232. RPL_TRACEHANDSHAKE = 202,
  233. RPL_TRACEUNKNOWN = 203,
  234. RPL_TRACEOPERATOR = 204,
  235. RPL_TRACEUSER = 205,
  236. RPL_TRACESERVER = 206,
  237. RPL_TRACESERVICE = 207,
  238. RPL_TRACENEWTYPE = 208,
  239. RPL_TRACECLASS = 209,
  240. RPL_TRACERECONNECT = 210,
  241. RPL_STATSLINKINFO = 211,
  242. RPL_STATSCOMMANDS = 212,
  243. RPL_ENDOFSTATS = 219,
  244. RPL_UMODEIS = 221,
  245. RPL_SERVLIST = 234,
  246. RPL_SERVLISTEND = 235,
  247. RPL_STATSUPTIME = 242,
  248. RPL_STATSOLINE = 243,
  249. RPL_LUSERCLIENT = 251,
  250. RPL_LUSEROP = 252,
  251. RPL_LUSERUNKNOWN = 253,
  252. RPL_LUSERCHANNELS = 254,
  253. RPL_LUSERME = 255,
  254. RPL_ADMINME = 256,
  255. RPL_ADMINLOC1 = 257,
  256. RPL_ADMINLOC2 = 258,
  257. RPL_ADMINEMAIL = 259,
  258. RPL_TRACELOG = 261,
  259. RPL_TRACEEND = 262,
  260. RPL_TRYAGAIN = 263,
  261. RPL_AWAY = 301,
  262. RPL_USERHOST = 302,
  263. RPL_ISON = 303,
  264. RPL_UNAWAY = 305,
  265. RPL_NOWAWAY = 306,
  266. RPL_WHOISUSER = 311,
  267. RPL_WHOISSERVER = 312,
  268. RPL_WHOISOPERATOR = 313,
  269. RPL_WHOWASUSER = 314,
  270. RPL_ENDOFWHO = 315,
  271. RPL_WHOISIDLE = 317,
  272. RPL_ENDOFWHOIS = 318,
  273. RPL_WHOISCHANNELS = 319,
  274. RPL_LISTSTART = 321,
  275. RPL_LIST = 322,
  276. RPL_LISTEND = 323,
  277. RPL_CHANNELMODEIS = 324,
  278. RPL_UNIQOPIS = 325,
  279. RPL_NOTOPIC = 331,
  280. RPL_TOPIC = 332,
  281. RPL_INVITING = 341,
  282. RPL_SUMMONING = 342,
  283. RPL_INVITELIST = 346,
  284. RPL_ENDOFINVITELIST = 347,
  285. RPL_EXCEPTLIST = 348,
  286. RPL_ENDOFEXCEPTLIST = 349,
  287. RPL_VERSION = 351,
  288. RPL_WHOREPLY = 352,
  289. RPL_NAMREPLY = 353,
  290. RPL_LINKS = 364,
  291. RPL_ENDOFLINKS = 365,
  292. RPL_ENDOFNAMES = 366,
  293. RPL_BANLIST = 367,
  294. RPL_ENDOFBANLIST = 368,
  295. RPL_ENDOFWHOWAS = 369,
  296. RPL_INFO = 371,
  297. RPL_MOTD = 372,
  298. RPL_ENDOFINFO = 374,
  299. RPL_MOTDSTART = 375,
  300. RPL_ENDOFMOTD = 376,
  301. RPL_YOUREOPER = 381,
  302. RPL_REHASHING = 382,
  303. RPL_YOURESERVICE = 383,
  304. RPL_TIME = 391,
  305. RPL_USERSSTART = 392,
  306. RPL_USERS = 393,
  307. RPL_ENDOFUSERS = 394,
  308. RPL_NOUSERS = 395
  309. }
  310. // IRC Error Codes //
  311. public enum IRCErrorCode
  312. {
  313. ERR_NOSUCHNICK = 401,
  314. ERR_NOSUCHSERVER = 402,
  315. ERR_NOSUCHCHANNEL = 403,
  316. ERR_CANNOTSENDTOCHAN = 404,
  317. ERR_TOOMANYCHANNELS = 405,
  318. ERR_WASNOSUCHNICK = 406,
  319. ERR_TOOMANYTARGETS = 407,
  320. ERR_NOSUCHSERVICE = 408,
  321. ERR_NOORIGIN = 409,
  322. ERR_NORECIPIENT = 411,
  323. ERR_NOTEXTTOSEND = 412,
  324. ERR_NOTOPLEVEL = 413,
  325. ERR_WILDTOPLEVEL = 414,
  326. ERR_BADMASK = 415,
  327. ERR_UNKNOWNCOMMAND = 421,
  328. ERR_NOMOTD = 422,
  329. ERR_NOADMININFO = 423,
  330. ERR_FILEERROR = 424,
  331. ERR_NONICKNAMEGIVEN = 431,
  332. ERR_ERRONEUSNICKNAME = 432,
  333. ERR_NICKNAMEINUSE = 433,
  334. ERR_NICKCOLLISION = 436,
  335. ERR_UNAVAILRESOURCE = 437,
  336. ERR_USERNOTINCHANNEL = 441,
  337. ERR_NOTONCHANNEL = 442,
  338. ERR_USERONCHANNEL = 443,
  339. ERR_NOLOGIN = 444,
  340. ERR_SUMMONDISABLED = 445,
  341. ERR_USERSDISABLED = 446,
  342. ERR_NOTREGISTERED = 451,
  343. ERR_NEEDMOREPARAMS = 461,
  344. ERR_ALREADYREGISTRED = 462,
  345. ERR_NOPERMFORHOST = 463,
  346. ERR_PASSWDMISMATCH = 464,
  347. ERR_YOUREBANNEDCREEP = 465,
  348. ERR_YOUWILLBEBANNED = 466,
  349. ERR_KEYSET = 467,
  350. ERR_CHANNELISFULL = 471,
  351. ERR_UNKNOWNMODE = 472,
  352. ERR_INVITEONLYCHAN = 473,
  353. ERR_BANNEDFROMCHAN = 474,
  354. ERR_BADCHANNELKEY = 475,
  355. ERR_BADCHANMASK = 476,
  356. ERR_NOCHANMODES = 477,
  357. ERR_BANLISTFULL = 478,
  358. ERR_NOPRIVILEGES = 481,
  359. ERR_CHANOPRIVSNEEDED = 482,
  360. ERR_CANTKILLSERVER = 483,
  361. ERR_RESTRICTED = 484,
  362. ERR_UNIQOPPRIVSNEEDED = 485,
  363. ERR_NOOPERHOST = 491,
  364. ERR_UMODEUNKNOWNFLAG = 501,
  365. ERR_USERSDONTMATCH = 502
  366. }
  367. }