forked from External/ergo
irc operators
This commit is contained in:
parent
6367e4b654
commit
8a90634c0a
5 changed files with 72 additions and 17 deletions
|
|
@ -21,6 +21,7 @@ var (
|
|||
"JOIN": NewJoinCommand,
|
||||
"MODE": NewModeCommand,
|
||||
"NICK": NewNickCommand,
|
||||
"OPER": NewOperCommand,
|
||||
"PART": NewPartCommand,
|
||||
"PASS": NewPassCommand,
|
||||
"PING": NewPingCommand,
|
||||
|
|
@ -541,3 +542,25 @@ func NewWhoCommand(args []string) (editableCommand, error) {
|
|||
func (msg *WhoCommand) String() string {
|
||||
return fmt.Sprintf("WHO(mask=%s, operatorOnly=%s)", msg.mask, msg.operatorOnly)
|
||||
}
|
||||
|
||||
type OperCommand struct {
|
||||
BaseCommand
|
||||
name string
|
||||
password string
|
||||
}
|
||||
|
||||
func (msg *OperCommand) String() string {
|
||||
return fmt.Sprintf("OPER(name=%s, password=%s)", msg.name, msg.password)
|
||||
}
|
||||
|
||||
// OPER <name> <password>
|
||||
func NewOperCommand(args []string) (editableCommand, error) {
|
||||
if len(args) < 2 {
|
||||
return nil, NotEnoughArgsError
|
||||
}
|
||||
|
||||
return &OperCommand{
|
||||
name: args[0],
|
||||
password: args[1],
|
||||
}, nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue