1
0
Fork 0
forked from External/ergo

WHOWAS command

This commit is contained in:
Jeremy Latt 2014-03-06 12:14:21 -08:00
parent 69cdad45ac
commit b2055595e1
4 changed files with 49 additions and 0 deletions

View file

@ -54,6 +54,7 @@ var (
VERSION: NewVersionCommand,
WHO: NewWhoCommand,
WHOIS: NewWhoisCommand,
WHOWAS: NewWhoWasCommand,
}
)
@ -968,3 +969,26 @@ func NewKillCommand(args []string) (editableCommand, error) {
comment: args[1],
}, nil
}
type WhoWasCommand struct {
BaseCommand
nicknames []string
count int64
target string
}
func NewWhoWasCommand(args []string) (editableCommand, error) {
if len(args) < 1 {
return nil, NotEnoughArgsError
}
cmd := &WhoWasCommand{
nicknames: strings.Split(args[0], ","),
}
if len(args) > 1 {
cmd.count, _ = strconv.ParseInt(args[1], 10, 64)
}
if len(args) > 2 {
cmd.target = args[2]
}
return cmd, nil
}