Documentation ¶
Index ¶
Constants ¶
View Source
const ( ADMIN = iota AWAY CONNECT DIE ERROR INFO INVITE ISON JOIN KICK KILL LINKS LIST LUSERS MODE MOTD NAMES NICK NJOIN NOTICE OPER PART PASS PING PONG PRIVMSG QUIT REHASH RESTART SERVER SERVICE SERVLIST SQUERY SQUIRT SQUIT STATS SUMMON TIME TOPIC TRACE USER USERHOST USERS VERSION WALLOPS WHO WHOIS WHOWAS )
Define the command types (good god there are a lot of these!)
Variables ¶
View Source
var Commands = []string{
"ADMIN",
"AWAY",
"CONNECT",
"DIE",
"ERROR",
"INFO",
"INVITE",
"ISON",
"JOIN",
"KICK",
"KILL",
"LINKS",
"LIST",
"LUSERS",
"MODE",
"MOTD",
"NAMES",
"NICK",
"NJOIN",
"NOTICE",
"OPER",
"PART",
"PASS",
"PING",
"PONG",
"PRIVMSG",
"QUIT",
"REHASH",
"RESTART",
"SERVER",
"SERVICE",
"SERVLIST",
"SQUERY",
"SQUIRT",
"SQUIT",
"STATS",
"SUMMON",
"TIME",
"TOPIC",
"TRACE",
"USER",
"USERHOST",
"USERS",
"VERSION",
"WALLOPS",
"WHO",
"WHOIS",
"WHOWAS",
}
Commands defines the commands in string form. The use of iota above means the constants provide indices into this array.
Functions ¶
This section is empty.
Types ¶
type IRCMessage ¶
type IRCMessage struct { Prefix string // With the colon removed. Response bool // Whether this is a response or a command. Command int // This or ResponseCode will be set, but not both. ResponseCode string // This must be a string to ensure that 001 stays 001. Arguments []string // Arbitrary number of arguments to any command. Trailing string // Anything that comes after the final colon in an IRC message. }
IRCMessage structure represents a parsed IRC message. These are used internally rather than byte buffers.
func NewIRCMessage ¶
func NewIRCMessage() *IRCMessage
NewIRCMEssage builds and initialises a new IRC message.
type IRCServer ¶
Represents a single IRC server. Currently there should be only one of these in a running instance of GoBot, or it will get very confused.
func NewIRCServerFromHostnamePort ¶
NewIRCServerFromHostnamePort creates a new IRCServer structure given a hostname-and-port string.
Click to show internal directories.
Click to hide internal directories.