bot

package
v0.0.0-...-ea53b9f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 2, 2016 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IN  = "-->"
	OUT = "<--"
	NOM = "--"
)
View Source
const (
	DefaultBotTrigger     = '/'
	DefaultChannelTrigger = '!'
	DefaultChannelLang    = "C"
)
View Source
const (
	RPL_WELCOME  // /* 001  RPL_WELCOME, */ ":Welcome to the %s Internet Relay Chat Network %s",
	RPL_YOURHOST // /* 002  RPL_YOURHOST,*/ ":Your host is %s, running version %s",
	RPL_CREATED  // /* 003  RPL_CREATED, */ ":This server was created %s",
	RPL_MYINFO   // /* 004  RPL_MYINFO, */ "%s %s %s %s bkloveqjfI",
	RPL_ISUPPORT // /* 005  RPL_ISUPPORT, */ "%s :are supported by this server",

	RPL_SNOMASK // /* 008  RPL_SNOMASK */  "%s :Server notice mask",

	RPL_REDIR // /* 010  RPL_REDIR, */ "%s %d :Please use this Server/Port instead",

	RPL_MAP // /* 015 RPL_MAP */    ":%s",

	RPL_MAPEND // /* 017 RPL_MAPEND */ ":End of /MAP",

	RPL_SAVENICK // /* 043 RPL_SAVENICK */       "%s :Nick collision, forcing nick change to your unique ID",

	RPL_TRACELINK       // /* 200 RPL_TRACELINK, */        "Link %s %s %s",
	RPL_TRACECONNECTING // /* 201 RPL_TRACECONNECTING, */  "Try. %s %s",
	RPL_TRACEHANDSHAKE  // /* 202 RPL_TRACEHANDSHAKE, */   "H.S. %s %s",
	RPL_TRACEUNKNOWN    // /* 203 RPL_TRACEUNKNOWN, */     "???? %s %s (%s) %d",
	RPL_TRACEOPERATOR   // /* 204 RPL_TRACEOPERATOR, */    "Oper %s %s (%s) %lu %lu",
	RPL_TRACEUSER       // /* 205 RPL_TRACEUSER, */        "User %s %s (%s) %lu %lu",
	RPL_TRACESERVER     // /* 206 RPL_TRACESERVER, */      "Serv %s %dS %dC %s %s!%s@%s %lu",

	RPL_TRACENEWTYPE // /* 208 RPL_TRACENEWTYPE, */     "<newtype> 0 %s",
	RPL_TRACECLASS   // /* 209 RPL_TRACECLASS, */       "Class %s %d",

	RPL_STATSCOMMANDS // /* 212 RPL_STATSCOMMANDS, */    "%s %u %u :%u",
	RPL_STATSCLINE    // /* 213 RPL_STATSCLINE, */       "C %s %s %s %d %s",

	RPL_STATSILINE // /* 215 RPL_STATSILINE, */       "I %s %s %s@%s %d %s",
	RPL_STATSKLINE // /* 216 RPL_STATSKLINE, */       "%c %s * %s :%s%s%s",
	RPL_STATSQLINE // /* 217 RPL_STATSQLINE, */       "%c %d %s :%s",
	RPL_STATSYLINE // /* 218 RPL_STATSYLINE, */       "Y %s %d %d %d %u %d.%d %d.%d %u",
	RPL_ENDOFSTATS // /* 219 RPL_ENDOFSTATS, */       "%c :End of /STATS report",
	RPL_STATSPLINE // /* 220 RPL_STATSPLINE, */       "%c %d %s %d :%s%s",
	RPL_UMODEIS    // /* 221 RPL_UMODEIS, */          "%s",

	RPL_STATSDLINE // /* 225 RPL_STATSDLINE*/         "%c %s :%s%s%s",

	RPL_STATSLLINE  // /* 241 RPL_STATSLLINE, */       "L %s * %s 0 -1",
	RPL_STATSUPTIME // /* 242 RPL_STATSUPTIME,*/       ":Server Up %d days, %d:%02d:%02d",
	RPL_STATSOLINE  // /* 243 RPL_STATSOLINE, */       "O %s@%s * %s %s %s",
	RPL_STATSHLINE  // /* 244 RPL_STATSHLINE, */       "H %s * %s 0 -1",

	RPL_STATSXLINE // /* 247 RPL_STATSXLINE, */	"%c %d %s :%s",
	RPL_STATSULINE // /* 248 RPL_STATSULINE, */       "U %s %s@%s %s",

	RPL_STATSCONN     // /* 250 RPL_STATSCONN, */	":Highest connection count: %d (%d clients) (%d connections received)",
	RPL_LUSERCLIENT   // /* 251 RPL_LUSERCLIENT, */	":There are %d users and %d invisible on %d servers",
	RPL_LUSEROP       // /* 252 RPL_LUSEROP, */          "%d :IRC Operators online",
	RPL_LUSERUNKNOWN  // /* 253 RPL_LUSERUNKNOWN, */     "%d :unknown connection(s)",
	RPL_LUSERCHANNELS // /* 254 RPL_LUSERCHANNELS, */    "%d :channels formed",
	RPL_LUSERME       // /* 255 RPL_LUSERME, */          ":I have %d clients and %d servers",
	RPL_ADMINME       // /* 256 RPL_ADMINME, */          ":Administrative info about %s",
	RPL_ADMINLOC1     // /* 257 RPL_ADMINLOC1, */        ":%s",
	RPL_ADMINLOC2     // /* 258 RPL_ADMINLOC2, */        ":%s",
	RPL_ADMINEMAIL    // /* 259 RPL_ADMINEMAIL, */       ":%s",

	RPL_ENDOFTRACE // /* 262 RPL_ENDOFTRACE, */       "%s :End of TRACE",
	RPL_LOAD2HI    // /* 263 RPL_LOAD2HI, */          ":%s 263 %s %s :This command could not be completed because it has been used recently, and is rate-limited.",

	RPL_LOCALUSERS  // /* 265 RPL_LOCALUSERS, */       "%d %d :Current local users %d, max %d",
	RPL_GLOBALUSERS // /* 266 RPL_GLOBALUSERS, */      "%d %d :Current global users %d, max %d",

	RPL_PRIVS // /* 270 RPL_PRIVS, */            "%s :%s",

	RPL_WHOISCERTFP // /* 276 RPL_WHOISCERTFP */       "%s :has client certificate fingerprint %s",

	RPL_ACCEPTLIST  // /* 281 RPL_ACCEPTLIST, */       ":%s 281 %s %s",
	RPL_ENDOFACCEPT // /* 282 RPL_ENDOFACCEPT */       ":%s 282 %s :End of /ACCEPT list.",

	RPL_AWAY     // /* 301 RPL_AWAY, */      "%s :%s",
	RPL_USERHOST // /* 302 RPL_USERHOST, */  ":%s 302 %s :%s",
	RPL_ISON     // /* 303 RPL_ISON, */     ":%s 303 %s :",

	RPL_UNAWAY  // /* 305 RPL_UNAWAY, */   ":You are no longer marked as being away",
	RPL_NOWAWAY // /* 306 RPL_NOWAWAY, */  ":You have been marked as being away",

	RPL_WHOISUSER     // /* 311 RPL_WHOISUSER, */        "%s %s %s * :%s",
	RPL_WHOISSERVER   // /* 312 RPL_WHOISSERVER, */      "%s %s :%s",
	RPL_WHOISOPERATOR // /* 313 RPL_WHOISOPERATOR, */    "%s :%s",
	RPL_WHOWASUSER    // /* 314 RPL_WHOWASUSER, */       ":%s 314 %s %s %s %s * :%s",
	RPL_ENDOFWHO      // /* 315 RPL_ENDOFWHO, */         ":%s 315 %s %s :End of /WHO list.",

	RPL_WHOISIDLE      // /* 317 RPL_WHOISIDLE, */        "%s %d %d :seconds idle, signon time",
	RPL_ENDOFWHOIS     // /* 318 RPL_ENDOFWHOIS, */       "%s :End of /WHOIS list.",
	RPL_WHOISCHANNELS  // /* 319 RPL_WHOISCHANNELS, */    ":%s 319 %s %s :",
	RPL_WHOISSPECIAL   // /* 320 RPL_WHOISSPECIAL*/       "%s :%s",
	RPL_LISTSTART      // /* 321 RPL_LISTSTART, */        ":%s 321 %s Channel :Users  Name",
	RPL_LIST           // /* 322 RPL_LIST, */             ":%s 322 %s %s%s %d :%s",
	RPL_LISTEND        // /* 323 RPL_LISTEND, */          ":%s 323 %s :End of /LIST",
	RPL_CHANNELMODEIS  // /* 324 RPL_CHANNELMODEIS, */    ":%s 324 %s %s %s",
	RPL_CHANNELMLOCKIS // /* 325 RPL_CHANNELMLOCKIS, */   ":%s 325 %s %s %s :is the current channel mode-lock",

	RPL_CHANNELURL    // /* 328 RPL_CHANNELURL */	NULL, // fluter
	RPL_CREATIONTIME  // /* 329 RPL_CREATIONTIME, */	":%s 329 %s %s %lu",
	RPL_WHOISLOGGEDIN // /* 330 RPL_WHOISLOGGEDIN */	"%s %s :is logged in as",
	RPL_NOTOPIC       // /* 331 RPL_NOTOPIC, */          ":%s 331 %s %s :No topic is set.",
	RPL_TOPIC         // /* 332 RPL_TOPIC, */            ":%s 332 %s %s :%s",
	RPL_TOPICWHOTIME  // /* 333 RPL_TOPICWHOTIME, */     ":%s 333 %s %s %s %lu",

	RPL_WHOISACTUALLY // /* 338 RPL_WHOISACTUALLY, */	"%s %s :actually using host",

	RPL_INVITING // /* 341 RPL_INVITING, */         ":%s 341 %s %s %s",

	RPL_INVEXLIST       // /* 346 RPL_INVEXLIST */         ":%s 346 %s %s %s %s %lu",
	RPL_ENDOFINVEXLIST  // /* 347 RPL_ENDOFINVEXLIST */    ":%s 347 %s %s :End of Channel Invite List",
	RPL_EXCEPTLIST      // /* 348 RPL_EXCEPTLIST */        ":%s 348 %s %s %s %s %lu",
	RPL_ENDOFEXCEPTLIST // /* 349 RPL_ENDOFEXCEPTLIST */   ":%s 349 %s %s :End of Channel Exception List",

	RPL_VERSION  // /* 351 RPL_VERSION, */          "%s(%s,charybdis-%s). %s :%s TS%dow %s",
	RPL_WHOREPLY // /* 352 RPL_WHOREPLY, */         ":%s 352 %s %s %s %s %s %s %s :%d %s",
	RPL_NAMREPLY // /* 353 RPL_NAMREPLY, */         ":%s 353 %s %s %s :",

	RPL_WHOWASREAL // /* 360 RPL_WHOWASREAL, */       ":%s 360 %s %s :was connecting from *@%s %s",

	RPL_CLOSING      // /* 362 RPL_CLOSING, */          ":%s 362 %s %s :Closed. Status = %d",
	RPL_CLOSEEND     // /* 363 RPL_CLOSEEND, */         ":%s 363 %s %d :Connections Closed",
	RPL_LINKS        // /* 364 RPL_LINKS, */            "%s %s :%d %s",
	RPL_ENDOFLINKS   // /* 365 RPL_ENDOFLINKS, */       "%s :End of /LINKS list.",
	RPL_ENDOFNAMES   // /* 366 RPL_ENDOFNAMES, */       ":%s 366 %s %s :End of /NAMES list.",
	RPL_BANLIST      // /* 367 RPL_BANLIST, */          ":%s 367 %s %s %s %s %lu",
	RPL_ENDOFBANLIST // /* 368 RPL_ENDOFBANLIST, */     ":%s 368 %s %s :End of Channel Ban List",
	RPL_ENDOFWHOWAS  // /* 369 RPL_ENDOFWHOWAS, */      ":%s 369 %s %s :End of WHOWAS",

	RPL_INFO // /* 371 RPL_INFO, */             ":%s",
	RPL_MOTD // /* 372 RPL_MOTD, */             ":%s 372 %s :- %s",

	RPL_ENDOFINFO // /* 374 RPL_ENDOFINFO, */        ":End of /INFO list.",
	RPL_MOTDSTART // /* 375 RPL_MOTDSTART, */        ":%s 375 %s :- %s Message of the Day - ",
	RPL_ENDOFMOTD // /* 376 RPL_ENDOFMOTD, */        ":%s 376 %s :End of /MOTD command.",

	RPL_WHOISHOST // /* 378 RPL_WHOISHOST, */        "%s :is connecting from *@%s %s",

	RPL_YOUREOPER // /* 381 RPL_YOUREOPER, */        ":%s 381 %s :And now to unleash stupidity on your entire brain.",
	RPL_REHASHING // /* 382 RPL_REHASHING, */        ":%s 382 %s %s :Rehashing",

	RPL_RSACHALLENGE // /* 386 RPL_RSACHALLENGE, */	":%s 386 %s :%s",

	RPL_TIME // /* 391 RPL_TIME, */             "%s :%s",

	RPL_HOSTHIDDEN // /* 396 */       NULL, // defined in header

	ERR_NOSUCHNICK       // /* 401 ERR_NOSUCHNICK, */       "%s :No such nick/channel",
	ERR_NOSUCHSERVER     // /* 402 ERR_NOSUCHSERVER, */     "%s :No such server",
	ERR_NOSUCHCHANNEL    // /* 403 ERR_NOSUCHCHANNEL, */    "%s :No such channel",
	ERR_CANNOTSENDTOCHAN // /* 404 ERR_CANNOTSENDTOCHAN, */ "%s :Cannot send to channel",
	ERR_TOOMANYCHANNELS  // /* 405 ERR_TOOMANYCHANNELS, */  ":%s 405 %s %s :You have joined too many channels",
	ERR_WASNOSUCHNICK    // /* 406 ERR_WASNOSUCHNICK, */    ":%s 406 %s %s :There was no such nickname",
	ERR_TOOMANYTARGETS   // /* 407 ERR_TOOMANYTARGETS, */   ":%s 407 %s %s :Too many recipients.",

	ERR_NOORIGIN      // /* 409 ERR_NOORIGIN, */         ":%s 409 %s :No origin specified",
	ERR_INVALIDCAPCMD // /* 410 ERR_INVALIDCAPCMD */	":%s 410 %s %s :Invalid CAP subcommand",
	ERR_NORECIPIENT   // /* 411 ERR_NORECIPIENT, */      ":%s 411 %s :No recipient given (%s)",
	ERR_NOTEXTTOSEND  // /* 412 ERR_NOTEXTTOSEND, */     ":%s 412 %s :No text to send",
	ERR_NOTOPLEVEL    // /* 413 ERR_NOTOPLEVEL, */       "%s :No toplevel domain specified",
	ERR_WILDTOPLEVEL  // /* 414 ERR_WILDTOPLEVEL, */     "%s :Wildcard in toplevel Domain",

	ERR_TOOMANYMATCHES // /* 416 ERR_TOOMANYMATCHES */    ":%s 416 %s %s :output too large, truncated",

	ERR_UNKNOWNCOMMAND // /* 421 ERR_UNKNOWNCOMMAND, */   ":%s 421 %s %s :Unknown command",
	ERR_NOMOTD         // /* 422 ERR_NOMOTD, */           ":%s 422 %s :MOTD File is missing",

	ERR_NONICKNAMEGIVEN  // /* 431 ERR_NONICKNAMEGIVEN, */  ":%s 431 %s :No nickname given",
	ERR_ERRONEUSNICKNAME // /* 432 ERR_ERRONEUSNICKNAME, */ ":%s 432 %s %s :Erroneous Nickname",
	ERR_NICKNAMEINUSE    // /* 433 ERR_NICKNAMEINUSE, */    ":%s 433 %s %s :Nickname is already in use.",

	ERR_BANNICKCHANGE   // /* 435 ERR_BANNICKCHANGE */     "%s %s :Cannot change nickname while banned on channel",
	ERR_NICKCOLLISION   // /* 436 ERR_NICKCOLLISION, */    "%s :Nickname collision KILL",
	ERR_UNAVAILRESOURCE // /* 437 ERR_UNAVAILRESOURCE, */	":%s 437 %s %s :Nick/channel is temporarily unavailable",
	ERR_NICKTOOFAST     // /* 438 ERR_NICKTOOFAST */       ":%s 438 %s %s %s :Nick change too fast. Please wait %d seconds.",

	ERR_SERVICESDOWN     // /* 440 ERR_SERVICESDOWN, */     "%s :Services are currently unavailable",
	ERR_USERNOTINCHANNEL // /* 441 ERR_USERNOTINCHANNEL, */ "%s %s :They aren't on that channel",
	ERR_NOTONCHANNEL     // /* 442 ERR_NOTONCHANNEL, */     "%s :You're not on that channel",
	ERR_USERONCHANNEL    // /* 443 ERR_USERONCHANNEL, */    "%s %s :is already on channel",

	ERR_NOTREGISTERED // /* 451 ERR_NOTREGISTERED, */    ":%s 451 * :You have not registered",

	ERR_ACCEPTFULL  // /* 456 ERR_ACCEPTFULL */        ":%s 456 %s :Accept list is full",
	ERR_ACCEPTEXIST // /* 457 ERR_ACCEPTEXIST */       ":%s 457 %s %s :is already on your accept list",
	ERR_ACCEPTNOT   // /* 458 ERR_ACCEPTNOT */         ":%s 458 %s %s :is not on your accept list",

	ERR_NEEDMOREPARAMS   // /* 461 ERR_NEEDMOREPARAMS, */   ":%s 461 %s %s :Not enough parameters",
	ERR_ALREADYREGISTRED // /* 462 ERR_ALREADYREGISTRED, */ ":%s 462 %s :You may not reregister",

	ERR_PASSWDMISMATCH   // /* 464 ERR_PASSWDMISMATCH, */   ":%s 464 %s :Password Incorrect",
	ERR_YOUREBANNEDCREEP // /* 465 ERR_YOUREBANNEDCREEP, */ ":%s 465 %s :You are banned from this server- %s",

	ERR_LINKCHANNEL    // /* 470 ERR_LINKCHANNEL */       "%s %s :Forwarding to another channel",
	ERR_CHANNELISFULL  // /* 471 ERR_CHANNELISFULL, */    ":%s 471 %s %s :Cannot join channel (+l) - channel is full, try again later",
	ERR_UNKNOWNMODE    // /* 472 ERR_UNKNOWNMODE  , */    ":%s 472 %s %c :is an unknown mode char to me",
	ERR_INVITEONLYCHAN // /* 473 ERR_INVITEONLYCHAN, */   ":%s 473 %s %s :Cannot join channel (+i) - you must be invited",
	ERR_BANNEDFROMCHAN // /* 474 ERR_BANNEDFROMCHAN, */   ":%s 474 %s %s :Cannot join channel (+b) - you are banned",
	ERR_BADCHANNELKEY  // /* 475 ERR_BADCHANNELKEY, */    ":%s 475 %s %s :Cannot join channel (+k) - bad key",

	ERR_NEEDREGGEDNICK   // /* 477 ERR_NEEDREGGEDNICK */	":%s 477 %s %s :Cannot join channel (+r) - you need to be identified with services",
	ERR_BANLISTFULL      // /* 478 ERR_BANLISTFULL, */      ":%s 478 %s %s %s :Channel ban list is full",
	ERR_BADCHANNAME      // /* 479 ERR_BADCHANNAME */       "%s :Illegal channel name",
	ERR_THROTTLE         // /* 480 ERR_THROTTLE */          ":%s 480 %s %s :Cannot join channel (+j) - throttle exceeded, try again later",
	ERR_NOPRIVILEGES     // /* 481 ERR_NOPRIVILEGES, */	":Permission Denied - You're not an IRC operator",
	ERR_CHANOPRIVSNEEDED // /* 482 ERR_CHANOPRIVSNEEDED, */ ":%s 482 %s %s :You're not a channel operator",
	ERR_CANTKILLSERVER   // /* 483 ERR_CANTKILLSERVER, */   ":You can't kill a server!",
	ERR_ISCHANSERVICE    // /* 484 ERR_ISCHANSERVICE */     ":%s 484 %s %s %s :Cannot kick or deop a network service",

	ERR_NONONREG // /* 486 ERR_NONONREG */          "%s :You must log in with services to message this user",

	ERR_VOICENEEDED // /* 489 ERR_VOICENEEDED */	":%s 489 %s %s :You're neither voiced nor channel operator",

	ERR_NOOPERHOST // /* 491 ERR_NOOPERHOST, */       ":No appropriate operator blocks were found for your host",

	ERR_OWNMODE // /* 494 ERR_OWNMODE, */          "%s :cannot answer you while you are %s, your message was not sent",

	ERR_UMODEUNKNOWNFLAG // /* 501 ERR_UMODEUNKNOWNFLAG, */ ":%s 501 %s :Unknown MODE flag",
	ERR_USERSDONTMATCH   // /* 502 ERR_USERSDONTMATCH, */   ":%s 502 %s :Can't change mode for other users",

	ERR_USERNOTONSERV // /* 504 ERR_USERNOTONSERV, */    ":%s 504 %s %s :User is not on this server",

	ERR_WRONGPONG // /* 513 ERR_WRONGPONG */		":%s 513 %s :To connect type /QUOTE PONG %08lX",

	ERR_DISABLED // /* 517 ERR_DISABLED */		"%s :This command has been administratively disabled",

	ERR_HELPNOTFOUND // /* 524 ERR_HELPNOTFOUND, */	":%s 524 %s %s :Help not found",

	RPL_WHOISSECURE // /* 671 RPL_WHOISSECURE, */	"%s :is using a secure connection",

	RPL_MODLIST       // /* 702 RPL_MODLIST, */		":%s 702 %s %s 0x%x %s %s",
	RPL_ENDOFMODLIST  // /* 703 RPL_ENDOFMODLIST, */	":%s 703 %s :End of /MODLIST.",
	RPL_HELPSTART     // /* 704 RPL_HELPSTART, */	":%s 704 %s %s :%s",
	RPL_HELPTXT       // /* 705 RPL_HELPTXT, */		":%s 705 %s %s :%s",
	RPL_ENDOFHELP     // /* 706 RPL_ENDOFHELP, */	":%s 706 %s %s :End of /HELP.",
	ERR_TARGCHANGE    // /* 707 ERR_TARGCHANGE */	":%s 707 %s %s :Targets changing too fast, message dropped",
	RPL_ETRACEFULL    // /* 708 RPL_ETRACEFULL */	":%s 708 %s %s %s %s %s %s %s %s :%s",
	RPL_ETRACE        // /* 709 RPL_ETRACE */		":%s 709 %s %s %s %s %s %s %s :%s",
	RPL_KNOCK         // /* 710 RPL_KNOCK */		":%s 710 %s %s %s!%s@%s :has asked for an invite.",
	RPL_KNOCKDLVR     // /* 711 RPL_KNOCKDLVR */		":%s 711 %s %s :Your KNOCK has been delivered.",
	ERR_TOOMANYKNOCK  // /* 712 ERR_TOOMANYKNOCK */	":%s 712 %s %s :Too many KNOCKs (%s).",
	ERR_CHANOPEN      // /* 713 ERR_CHANOPEN */		"%s :Channel is open.",
	ERR_KNOCKONCHAN   // /* 714 ERR_KNOCKONCHAN */	":%s 714 %s %s :You are already on that channel.",
	ERR_KNOCKDISABLED // /* 715 ERR_KNOCKDISABLED */	":%s 715 %s :KNOCKs are disabled.",
	ERR_TARGUMODEG    // /* 716 ERR_TARGUMODEG */	"%s :is in +g mode (server-side ignore.)",
	RPL_TARGNOTIFY    // /* 717 RPL_TARGNOTIFY */	"%s :has been informed that you messaged them.",
	RPL_UMODEGMSG     // /* 718 RPL_UMODEGMSG */		":%s 718 %s %s %s@%s :is messaging you, and you have umode +g.",

	RPL_OMOTDSTART // /* 720 RPL_OMOTDSTART */	":%s 720 %s :Start of OPER MOTD",
	RPL_OMOTD      // /* 721 RPL_OMOTD */		":%s 721 %s :%s",
	RPL_ENDOFOMOTD // /* 722 RPL_ENDOFOMOTD */	":%s 722 %s :End of OPER MOTD",
	ERR_NOPRIVS    // /* 723 ERR_NOPRIVS */		":%s 723 %s %s :Insufficient oper privs",

	RPL_TESTLINE       // /* 725 RPL_TESTLINE */		":%s 725 %s %c %ld %s :%s",
	RPL_NOTESTLINE     // /* 726 RPL_NOTESTLINE */	":%s 726 %s %s :No matches",
	RPL_TESTMASKGECOS  // /* 727 RPL_TESTMASKGECOS */     ":%s 727 %s %d %d %s!%s@%s %s :Local/remote clients match",
	RPL_QUIETLIST      // /* 728 RPL_QUIETLIST */		":%s 728 %s %s q %s %s %lu",
	RPL_ENDOFQUIETLIST // /* 729 RPL_ENDOFQUIETLIST */ ":%s 729 %s %s q :End of Channel Quiet List",
	RPL_MONONLINE      // /* 730 RPL_MONONLINE */		":%s 730 %s :%s",
	RPL_MONOFFLINE     // /* 731 RPL_MONOFFLINE */	":%s 731 %s :%s",
	RPL_MONLIST        // /* 732 RPL_MONLIST */		":%s 732 %s :%s",
	RPL_ENDOFMONLIST   // /* 733 RPL_ENDOFMONLIST */	":%s 733 %s :End of MONITOR list",
	ERR_MONLISTFULL    // /* 734 ERR_MONLISTFULL */	":%s 734 %s %d %s :Monitor list is full",

	RPL_RSACHALLENGE2      // /* 740 RPL_RSACHALLENGE2*/	":%s 740 %s :%s",
	RPL_ENDOFRSACHALLENGE2 // /* 741 RPL_ENDOFRSACHALLENGE2*/	":%s 741 %s :End of CHALLENGE",
	ERR_MLOCKRESTRICTED    // /* 742 ERR_MLOCKRESTRICTED */	"%s %c %s :MODE cannot be set due to channel having an active MLOCK restriction policy",

	RPL_SCANMATCHED // /* 750 RPL_SCANMATCHED */	"%d :matches",
	RPL_SCANUMODES  // /* 751 RPL_SCANUMODES */	"%s %s %s %s %s %s :%s",

	RPL_LOGGEDIN    // /* 900 RPL_LOGGEDIN */		":%s 900 %s %s!%s@%s %s :You are now logged in as %s.",
	RPL_LOGGEDOUT   // /* 901 RPL_LOGGEDOUT */		":%s 901 %s %s!%s@%s :You are now logged out.",
	ERR_NICKLOCKED  // /* 902 ERR_NICKLOCKED */	":%s 902 %s :You must use a nick assigned to you.",
	RPL_SASLSUCCESS // /* 903 RPL_SASLSUCCESS */	":%s 903 %s :SASL authentication successful",
	ERR_SASLFAIL    // /* 904 ERR_SASLFAIL */		":%s 904 %s :SASL authentication failed",
	ERR_SASLTOOLONG // /* 905 ERR_SASLTOOLONG */	":%s 905 %s :SASL message too long",
	ERR_SASLABORTED // /* 906 ERR_SASLABORTED */	":%s 906 %s :SASL authentication aborted",
	ERR_SASLALREADY // /* 907 ERR_SASLALREADY */	":%s 907 %s :You have already completed SASL authentication",

	ERR_MSG // /* 999 LAST ERR_LAST_ERR_MSG,*/	":%s 999 %s :Last Error Message"
)
View Source
const (
	Major = 0
	Minor = 4
	Rel   = 1
)
View Source
const (
	G = "Subhuti"
)
View Source
const (
	Ping_interval = 1 * time.Minute
)

Variables

View Source
var (
	ErrFactoidNotFound = errors.New("Factoid does not exist")
	ErrFactoidExists   = errors.New("Factoid already exist")
	ErrFactoidChange   = errors.New("Invalid factoid change format")
)
View Source
var (
	ErrSpaceNotFound = errors.New("Store namespace not found")
	ErrDirNotFound   = errors.New("Directory not found")
	ErrKeyNotFound   = errors.New("Key not found")
)
View Source
var NewLoggerFunc = NewLogger
View Source
var Numerics [1000]string = [1000]string{}/* 1000 elements not displayed */
View Source
var (
	SpaceNames = map[StoreSpace]string{
		ROOT:    "ROOT",
		FACTOID: "FACTOID",
	}
)

Functions

func IsChannel

func IsChannel(name string) bool

func IsNick

func IsNick(name string) bool

func NewLogger

func NewLogger(name string) *log.Logger

func NewTestLogger

func NewTestLogger(name string) *log.Logger

func RegisterInitModuleFunc

func RegisterInitModuleFunc(f func(*Bot) Module)

RegisterInitModuleFunc registers f to initModuleFuncs.

func SaveToFile

func SaveToFile(config *BotConfig, path string) error

func Source

func Source() string

func SourceCommand

func SourceCommand(*MessageRequest, string) (string, error)

func Version

func Version() string

func VersionCommand

func VersionCommand(*MessageRequest, string) (string, error)

Types

type APIKey

type APIKey struct {
	// contains filtered or unexported fields
}

API key for youtube client

func (*APIKey) Get

func (k *APIKey) Get() (string, string)

type BaseModule

type BaseModule struct {
	Name  string
	State ModState

	Logger *log.Logger
	// contains filtered or unexported fields
}

type BoltStore

type BoltStore struct {
	// contains filtered or unexported fields
}

func (*BoltStore) Close

func (b *BoltStore) Close()

func (*BoltStore) Delete

func (b *BoltStore) Delete(key string) error

func (*BoltStore) Exists

func (b *BoltStore) Exists(key string) (bool, error)

func (*BoltStore) Get

func (b *BoltStore) Get(key string) (*Pair, error)

func (*BoltStore) List

func (b *BoltStore) List() ([]*Pair, error)

func (*BoltStore) Put

func (b *BoltStore) Put(key string, value []byte) error

type Bot

type Bot struct {
	BaseModule
	// contains filtered or unexported fields
}

func NewBot

func NewBot(name string, config *BotConfig) *Bot

func (*Bot) AddEvent

func (bot *Bot) AddEvent(event *Event)

events

func (*Bot) RegisterEventHandler

func (bot *Bot) RegisterEventHandler(evt EventType, h EventHandler)

func (*Bot) RegisterEventHandlerPrio

func (bot *Bot) RegisterEventHandlerPrio(evt EventType, h EventHandler, p Priority)

func (*Bot) Start

func (bot *Bot) Start()

func (*Bot) Stop

func (bot *Bot) Stop()

func (*Bot) String

func (bot *Bot) String() string

type BotConfig

type BotConfig struct {
	Proxy         string
	HomeDir       string
	LogDir        string
	DataDir       string
	DB            string
	Trigger       byte
	CompileServer string
	YoutubeAPIKey string
	IRC           []*IRCConfig
	// contains filtered or unexported fields
}

func LoadFromFile

func LoadFromFile(path string) (*BotConfig, error)

func NewConfig

func NewConfig() *BotConfig

func (*BotConfig) GetIRC

func (config *BotConfig) GetIRC(server string) *IRCConfig

func (*BotConfig) GetTrigger

func (config *BotConfig) GetTrigger() byte

func (*BotConfig) Load

func (config *BotConfig) Load(path string) error

func (*BotConfig) Save

func (config *BotConfig) Save(path string) error

func (*BotConfig) String

func (config *BotConfig) String() string

type CTCP

type CTCP string
const (
	FINGER     CTCP = "FINGER"
	VERSION    CTCP = "VERSION"
	SOURCE     CTCP = "SOURCE"
	USERINFO   CTCP = "USERINFO"
	CLIENTINFO CTCP = "CLIENTINFO"
	ERRMSG     CTCP = "ERRMSG"
	PING       CTCP = "PING"
	TIME       CTCP = "TIME"
)

type Channel

type Channel struct {
	// contains filtered or unexported fields
}

func NewChannel

func NewChannel(irc *IRC, name string) *Channel

func (*Channel) Log

func (ch *Channel) Log(dir, format string, param ...interface{})

func (*Channel) SetTopic

func (ch *Channel) SetTopic(topic string)

func (*Channel) Start

func (ch *Channel) Start(me string)

func (*Channel) Stop

func (ch *Channel) Stop()

func (*Channel) String

func (ch *Channel) String() string

func (*Channel) Topic

func (ch *Channel) Topic() string

type ChannelConfig

type ChannelConfig struct {
	Name           string
	Trigger        byte
	IgnoreURLTitle bool
	Lang           string
	Repaste        bool
}

type ChannelMessageData

type ChannelMessageData struct {
	PrivateMessageData
	// contains filtered or unexported fields
}

ChannelMessage

type Cjeopardy

type Cjeopardy struct {
	BaseModule
	// contains filtered or unexported fields
}

func (*Cjeopardy) Init

func (cj *Cjeopardy) Init() error

func (*Cjeopardy) Run

func (cj *Cjeopardy) Run()

func (*Cjeopardy) Start

func (cj *Cjeopardy) Start() error

func (*Cjeopardy) Status

func (cj *Cjeopardy) Status() string

func (*Cjeopardy) Stop

func (cj *Cjeopardy) Stop() error

func (*Cjeopardy) String

func (cj *Cjeopardy) String() string

type CodePasteChecker

type CodePasteChecker struct {
	BaseModule
	// contains filtered or unexported fields
}

func (*CodePasteChecker) Init

func (cp *CodePasteChecker) Init() error

func (*CodePasteChecker) Run

func (cp *CodePasteChecker) Run()

func (*CodePasteChecker) Start

func (cp *CodePasteChecker) Start() error

func (*CodePasteChecker) Status

func (cp *CodePasteChecker) Status() string

func (*CodePasteChecker) Stop

func (cp *CodePasteChecker) Stop() error

func (*CodePasteChecker) String

func (cp *CodePasteChecker) String() string

type Command

type Command func(*MessageRequest, string) (string, error)

type CommandEngine

type CommandEngine struct {
	BaseModule
	// contains filtered or unexported fields
}

func NewCommandEngine

func NewCommandEngine(bot *Bot) *CommandEngine

func (*CommandEngine) AddCommand

func (e *CommandEngine) AddCommand(cmd string, f func(string) error)

maitains the comand map

func (*CommandEngine) DelCommand

func (e *CommandEngine) DelCommand(cmd string)

func (*CommandEngine) Init

func (e *CommandEngine) Init() error

func (*CommandEngine) Run

func (e *CommandEngine) Run()

func (*CommandEngine) Start

func (e *CommandEngine) Start() error

func (*CommandEngine) Status

func (e *CommandEngine) Status() string

func (*CommandEngine) Stop

func (e *CommandEngine) Stop() error

func (*CommandEngine) String

func (e *CommandEngine) String() string

func (*CommandEngine) Submit

func (e *CommandEngine) Submit(input string)

type CommandHandler

type CommandHandler func(string, string)

IRC command handler, args: prefix, params

type Empty

type Empty struct{}

type Event

type Event struct {
	// contains filtered or unexported fields
}

func NewEvent

func NewEvent(typ EventType, data interface{}) *Event

func (Event) String

func (event Event) String() string

type EventBase

type EventBase struct {
	// contains filtered or unexported fields
}

type EventHandler

type EventHandler func(interface{})

type EventHandlers

type EventHandlers *[2][]EventHandler

type EventType

type EventType int
const (
	Input EventType = iota
	UserJoin
	UserPart
	UserQuit
	UserNick
	Pong
	PrivateMessage
	ChannelMessage
	Disconnect
	MessageParseEvent
	EventCount
)

func (EventType) String

func (evt EventType) String() string

type Factoid

type Factoid struct {
	Network  string
	Channel  string
	Owner    string
	Nick     string
	Keyword  string
	Desc     string
	Created  time.Time
	RefCount int
	RefUser  string
	RefTime  time.Time
	Enabled  bool
}

func (*Factoid) String

func (f *Factoid) String() string

type FactoidProcessor

type FactoidProcessor struct {
	BaseModule
	// contains filtered or unexported fields
}

func (*FactoidProcessor) Init

func (f *FactoidProcessor) Init() error

func (*FactoidProcessor) Run

func (f *FactoidProcessor) Run()

func (*FactoidProcessor) Start

func (f *FactoidProcessor) Start() error

func (*FactoidProcessor) Status

func (f *FactoidProcessor) Status() string

func (*FactoidProcessor) Stop

func (f *FactoidProcessor) Stop() error

func (*FactoidProcessor) String

func (f *FactoidProcessor) String() string

type Factoids

type Factoids struct {
	// contains filtered or unexported fields
}

func NewFactoids

func NewFactoids(dbpath string) *Factoids

func (*Factoids) Add

func (factoids *Factoids) Add(fact *Factoid) error

func (*Factoids) Change

func (factoids *Factoids) Change(fact *Factoid) error

func (*Factoids) Close

func (factoids *Factoids) Close()

func (*Factoids) Count

func (factoids *Factoids) Count() int

func (*Factoids) Dump

func (factoids *Factoids) Dump(w io.Writer) error

func (*Factoids) Find

func (factoids *Factoids) Find(fact *Factoid) ([]*Factoid, error)

func (*Factoids) Get

func (factoids *Factoids) Get(fact *Factoid) (*Factoid, error)

func (*Factoids) Remove

func (factoids *Factoids) Remove(fact *Factoid) error

type IRC

type IRC struct {
	BaseModule
	// contains filtered or unexported fields
}

func NewIRC

func NewIRC(bot *Bot, config *IRCConfig) *IRC

func (*IRC) Away

func (irc *IRC) Away(text string) error

func (*IRC) Ctcp

func (irc *IRC) Ctcp(target, typ, param string)

commands

func (*IRC) CtcpReply

func (irc *IRC) CtcpReply(typ CTCP, target, reply string)

func (*IRC) Ctcp_Clientinfo

func (irc *IRC) Ctcp_Clientinfo(target string) error

func (*IRC) Ctcp_Errmsg

func (irc *IRC) Ctcp_Errmsg(target, msg string) error

func (*IRC) Ctcp_Finger

func (irc *IRC) Ctcp_Finger(target string) error

func (*IRC) Ctcp_Ping

func (irc *IRC) Ctcp_Ping(target string) error

func (*IRC) Ctcp_Source

func (irc *IRC) Ctcp_Source(target string) error

func (*IRC) Ctcp_Time

func (irc *IRC) Ctcp_Time(target string) error

func (*IRC) Ctcp_Userinfo

func (irc *IRC) Ctcp_Userinfo(target string) error

func (*IRC) Ctcp_Version

func (irc *IRC) Ctcp_Version(target string) error

func (*IRC) GetChannel

func (irc *IRC) GetChannel(ch string) *Channel

Channel management

func (*IRC) GetTopic

func (irc *IRC) GetTopic(channel string) error

func (*IRC) Info

func (irc *IRC) Info(target string) error

func (*IRC) Init

func (irc *IRC) Init() error

Module interface

func (*IRC) Invite

func (irc *IRC) Invite(nick, channel string) error

list invite :adams.freenode.net 341 fluter candice #rdma

func (*IRC) IsOn

func (irc *IRC) IsOn(nick string) error

func (*IRC) Join

func (irc *IRC) Join(channel string) error

func (*IRC) JoinChannel

func (irc *IRC) JoinChannel(ch string) *Channel

func (*IRC) Kill

func (irc *IRC) Kill(nick, comment string) error

func (*IRC) LeaveChannel

func (irc *IRC) LeaveChannel(ch string) *Channel
func (irc *IRC) Links() error

func (*IRC) Lusers

func (irc *IRC) Lusers() error

func (*IRC) Mode

func (irc *IRC) Mode(nick string, mode string) error

func (*IRC) Motd

func (irc *IRC) Motd() error

server query

func (*IRC) Names

func (irc *IRC) Names(channel string) error

func (*IRC) Nick

func (irc *IRC) Nick(nick string) error

func (*IRC) Notice

func (irc *IRC) Notice(to, msg string) error

func (*IRC) Oper

func (irc *IRC) Oper(name, passwd string) error

func (*IRC) Part

func (irc *IRC) Part(channel, partMsg string) error

func (*IRC) Ping

func (irc *IRC) Ping(server string) error

func (*IRC) Pong

func (irc *IRC) Pong(server string) error

func (*IRC) Privmsg

func (irc *IRC) Privmsg(to, msg string) error

func (*IRC) Quit

func (irc *IRC) Quit(qmsg string) error

func (*IRC) Run

func (irc *IRC) Run()

func (*IRC) Service

func (irc *IRC) Service(nick, dist, typ, info string) error

func (*IRC) SetTopic

func (irc *IRC) SetTopic(channel, topic string) error

func (*IRC) Start

func (irc *IRC) Start() error

func (*IRC) Stats

func (irc *IRC) Stats(query string) error

func (*IRC) Status

func (irc *IRC) Status() string

func (*IRC) Stop

func (irc *IRC) Stop() error

func (*IRC) String

func (irc *IRC) String() string

func (*IRC) Time

func (irc *IRC) Time() error

func (*IRC) Trace

func (irc *IRC) Trace(target string) error

func (*IRC) Userhost

func (irc *IRC) Userhost(nick string) error

func (*IRC) Users

func (irc *IRC) Users(target string) error

func (*IRC) Version

func (irc *IRC) Version() error

func (*IRC) WallOps

func (irc *IRC) WallOps(text string) error

func (*IRC) Who

func (irc *IRC) Who(mask string, flag string) error

func (*IRC) Whois

func (irc *IRC) Whois(target string, mask string) error

func (*IRC) Whowas

func (irc *IRC) Whowas(nick string) error

type IRCCommand

type IRCCommand struct {
	// contains filtered or unexported fields
}

type IRCConfig

type IRCConfig struct {
	Name            string
	Server          string
	Port            int
	Ssl             bool
	BotNick         string
	Username        string
	RealName        string
	Identify_passwd string
	Trigger         byte
	RawLogging      bool
	AutoConnect     bool
	DebugMode       bool
	RedirectTo      string
	Channels        []*ChannelConfig
}

func (*IRCConfig) ChannelLang

func (config *IRCConfig) ChannelLang(channel string) string

func (*IRCConfig) ChannelRepaste

func (config *IRCConfig) ChannelRepaste(channel string) bool

func (*IRCConfig) GetTrigger

func (config *IRCConfig) GetTrigger(channel string) string

func (*IRCConfig) IgnoreURLTitle

func (config *IRCConfig) IgnoreURLTitle(channel string) bool

func (*IRCConfig) String

func (config *IRCConfig) String() string

type Interpreter

type Interpreter struct {
	BaseModule
	// contains filtered or unexported fields
}

func NewInterpreter

func NewInterpreter(irc *IRC) *Interpreter

func (*Interpreter) DelCommand

func (i *Interpreter) DelCommand(name string)

func (*Interpreter) GetCommand

func (i *Interpreter) GetCommand(name string) Command

func (*Interpreter) Init

func (i *Interpreter) Init() error

func (*Interpreter) RegisterCommand

func (i *Interpreter) RegisterCommand(name string, cmd Command)

commands management

func (*Interpreter) Run

func (i *Interpreter) Run()

func (*Interpreter) Start

func (i *Interpreter) Start() error

func (*Interpreter) Status

func (i *Interpreter) Status() string

func (*Interpreter) Stop

func (i *Interpreter) Stop() error

func (*Interpreter) String

func (i *Interpreter) String() string

func (*Interpreter) Submit

func (i *Interpreter) Submit(req *MessageRequest)

channels

type LagChecker

type LagChecker struct {
	BaseModule
	// contains filtered or unexported fields
}

func (*LagChecker) Init

func (lc *LagChecker) Init() error

func (*LagChecker) Run

func (lc *LagChecker) Run()

func (*LagChecker) Start

func (lc *LagChecker) Start() error

func (*LagChecker) Status

func (lc *LagChecker) Status() string

func (*LagChecker) Stop

func (lc *LagChecker) Stop() error

func (*LagChecker) String

func (lc *LagChecker) String() string

type MessageRequest

type MessageRequest struct {
	// contains filtered or unexported fields
}

Message data for intepret

func (*MessageRequest) String

func (req *MessageRequest) String() string

type ModState

type ModState int
const (
	Initialized ModState = iota
	Disconnected
	Connected
	Logged
	Identified
	Running
	Stopped
)

func (ModState) String

func (s ModState) String() string

type Module

type Module interface {
	Init() error
	Start() error
	Stop() error
	Status() string
	Run()
}

func NewCjeopardy

func NewCjeopardy(bot *Bot) Module

func NewCodePasteChecker

func NewCodePasteChecker(bot *Bot) Module

func NewFactoidProcessor

func NewFactoidProcessor(bot *Bot) Module

func NewLagChecker

func NewLagChecker(bot *Bot) Module

func NewPagetitle

func NewPagetitle(bot *Bot) Module

func NewYoutube

func NewYoutube(bot *Bot) Module

type Pagetitle

type Pagetitle struct {
	BaseModule
	// contains filtered or unexported fields
}

func (*Pagetitle) Init

func (t *Pagetitle) Init() error

func (*Pagetitle) Run

func (t *Pagetitle) Run()

func (*Pagetitle) Start

func (t *Pagetitle) Start() error

func (*Pagetitle) Status

func (t *Pagetitle) Status() string

func (*Pagetitle) Stop

func (t *Pagetitle) Stop() error

func (*Pagetitle) String

func (t *Pagetitle) String() string

type Pair

type Pair struct {
	Key   string
	Value []byte
}

type PongData

type PongData struct {
	// contains filtered or unexported fields
}

type Priority

type Priority int

Priority defines the order of the invoke of the handlers. Handlers with High priority is invoke first.

const (
	High Priority = iota
	Low
)

type PrivateMessageData

type PrivateMessageData struct {
	EventBase
	// contains filtered or unexported fields
}

PrivateMessage

type Stdin

type Stdin struct {
	BaseModule
	// contains filtered or unexported fields
}

func NewStdin

func NewStdin(bot *Bot) *Stdin

func (*Stdin) Init

func (stdin *Stdin) Init() error

func (*Stdin) Loop2

func (stdin *Stdin) Loop2()

func (*Stdin) Run

func (stdin *Stdin) Run()

func (*Stdin) Start

func (stdin *Stdin) Start() error

func (*Stdin) Status

func (stdin *Stdin) Status() string

func (*Stdin) Stop

func (stdin *Stdin) Stop() error

func (*Stdin) String

func (stdin *Stdin) String() string

type Store

type Store interface {
	Put(key string, value []byte) error
	Get(key string) (*Pair, error)
	Delete(key string) error
	Exists(key string) (bool, error)
	List() ([]*Pair, error)
	Close()
}

func NewStore

func NewStore(path string) (Store, error)

func NewStoreSpace

func NewStoreSpace(path string, space StoreSpace) (Store, error)

type StoreSpace

type StoreSpace int
const (
	ROOT StoreSpace = iota
	FACTOID
)

type UserJoinData

type UserJoinData struct {
	EventBase
	// contains filtered or unexported fields
}

type UserNickData

type UserNickData struct {
	EventBase
	// contains filtered or unexported fields
}

type UserPartData

type UserPartData struct {
	EventBase
	// contains filtered or unexported fields
}

type UserQuitData

type UserQuitData struct {
	EventBase
	// contains filtered or unexported fields
}

type Youtube

type Youtube struct {
	BaseModule
	// contains filtered or unexported fields
}

func (*Youtube) Init

func (yt *Youtube) Init() error

func (*Youtube) Run

func (yt *Youtube) Run()

func (*Youtube) Start

func (yt *Youtube) Start() error

func (*Youtube) Status

func (yt *Youtube) Status() string

func (*Youtube) Stop

func (yt *Youtube) Stop() error

func (*Youtube) String

func (yt *Youtube) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL