Ejemplo n.º 1
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)
}
Ejemplo n.º 2
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)
}
Ejemplo n.º 3
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)
}