1
0
Fork 0
forked from External/ergo

notice command

This commit is contained in:
Jeremy Latt 2014-02-11 17:11:59 -08:00
parent 09887b2db3
commit 6daf81ea91
5 changed files with 55 additions and 0 deletions

View file

@ -25,6 +25,7 @@ var (
"MODE": NewModeCommand,
"MOTD": NewMOTDCommand,
"NICK": NewNickCommand,
"NOTICE": NewNoticeCommand,
"OPER": NewOperCommand,
"PART": NewPartCommand,
"PASS": NewPassCommand,
@ -665,3 +666,23 @@ func NewMOTDCommand(args []string) (editableCommand, error) {
}
return cmd, nil
}
type NoticeCommand struct {
BaseCommand
target string
message string
}
func (cmd *NoticeCommand) String() string {
return fmt.Sprintf("NOTICE(target=%s, message=%s)", cmd.target, cmd.message)
}
func NewNoticeCommand(args []string) (editableCommand, error) {
if len(args) < 2 {
return nil, NotEnoughArgsError
}
return &NoticeCommand{
target: args[0],
message: args[1],
}, nil
}