forked from External/ergo
notice command
This commit is contained in:
parent
09887b2db3
commit
6daf81ea91
5 changed files with 55 additions and 0 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue