Exemplo n.º 1
0
func init() {
	var c *irc.Command

	// Add login command.
	c = new(irc.Command)
	c.Name = "LOGIN"
	c.Handler = cmdLogin
	c.Minargs = 1
	c.Maxargs = 2
	c.Unregged = 1
	client.Commands.Add(c)

	// Add pass command, just an alias.
	c = new(irc.Command)
	c.Name = "PASS"
	c.Handler = cmdLogin
	c.Minargs = 1
	c.Maxargs = 2
	c.Unregged = 1
	client.Commands.Add(c)

	// Add identify command, just an alias.
	c = new(irc.Command)
	c.Name = "IDENTIFY"
	c.Handler = cmdLogin
	c.Minargs = 1
	c.Maxargs = 2
	c.Unregged = 1
	client.Commands.Add(c)
}
Exemplo n.º 2
0
func init() {
	var c *irc.Command
	if Commands == nil {
		Commands = irc.NewCommandDispatcher()
	}

	c = new(irc.Command)
	c.Name = "VERSION"
	c.Handler = cmdVersion
	Commands.Add(c)

	c = new(irc.Command)
	c.Name = "USERHOST"
	c.Handler = cmdUserhost
	c.Minargs = 1
	c.Maxargs = 1
	Commands.Add(c)

	c = new(irc.Command)
	c.Name = "ISON"
	c.Handler = cmdIsOn
	c.Minargs = 1
	c.Maxargs = 1
	Commands.Add(c)

	c = new(irc.Command)
	c.Name = "WHO"
	c.Handler = cmdWho
	c.Minargs = 1
	c.Maxargs = 1
	Commands.Add(c)

	c = new(irc.Command)
	c.Name = "NAMES"
	c.Handler = cmdNames
	c.Minargs = 1
	c.Maxargs = 1
	Commands.Add(c)

	c = new(irc.Command)
	c.Name = "TIME"
	c.Handler = cmdTime
	Commands.Add(c)

	c = new(irc.Command)
	c.Name = "OPFLAGS"
	c.Handler = cmdOpflags
	c.Minargs = 2
	c.Maxargs = 2
	Commands.Add(c)

	c = new(irc.Command)
	c.Name = "OPERFLAGS"
	c.Handler = cmdOperflags
	c.Minargs = 1
	c.Maxargs = 1
	c.OperFlag = "viewflags"
	Commands.Add(c)
}
Exemplo n.º 3
0
// Add command.
func init() {
	c := new(irc.Command)
	c.Name = "OKICK"
	c.Handler = cmdOkick
	c.Minargs = 2
	c.Maxargs = 3
	c.OperFlag = "chanctrl"
	client.Commands.Add(c)
}
Exemplo n.º 4
0
// Add core oper commands.
func init() {
	var c *irc.Command
	if Commands == nil {
		Commands = irc.NewCommandDispatcher()
	}

	c = new(irc.Command)
	c.Name = "KILL"
	c.Handler = cmdKill
	c.Minargs = 2
	c.Maxargs = 2
	c.OperFlag = "ban"
	Commands.Add(c)

	c = new(irc.Command)
	c.Name = "DIE"
	c.Handler = cmdDie
	c.OperFlag = "shutdown"
	Commands.Add(c)
}
Exemplo n.º 5
0
// Add core user commands.
func init() {
	var c *irc.Command
	if Commands == nil {
		Commands = irc.NewCommandDispatcher()
	}

	c = new(irc.Command)
	c.Name = "USER"
	c.Handler = cmdUser
	c.Minargs = 4
	c.Maxargs = 4
	c.Unregged = 2
	Commands.Add(c)

	c = new(irc.Command)
	c.Name = "NICK"
	c.Handler = cmdNick
	c.Minargs = 1
	c.Maxargs = 1
	c.Unregged = 1
	Commands.Add(c)

	c = new(irc.Command)
	c.Name = "AWAY"
	c.Handler = cmdAway
	c.Maxargs = 1
	Commands.Add(c)

	c = new(irc.Command)
	c.Name = "QUIT"
	c.Handler = cmdQuit
	c.Maxargs = 1
	c.Unregged = 1
	Commands.Add(c)

	c = new(irc.Command)
	c.Name = "PING"
	c.Handler = cmdPing
	c.Minargs = 1
	c.Maxargs = 1
	Commands.Add(c)

	c = new(irc.Command)
	c.Name = "MODE"
	c.Handler = cmdMode
	c.Minargs = 1
	c.Maxargs = 3
	Commands.Add(c)

	c = new(irc.Command)
	c.Name = "PRIVMSG"
	c.Handler = cmdPrivmsg
	c.Minargs = 2
	c.Maxargs = 2
	Commands.Add(c)

	c = new(irc.Command)
	c.Name = "NOTICE"
	c.Handler = cmdNotice
	c.Minargs = 2
	c.Maxargs = 2
	Commands.Add(c)
}