diff options
Diffstat (limited to 'commands.go')
-rw-r--r-- | commands.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/commands.go b/commands.go index 3428ff2..6fb501f 100644 --- a/commands.go +++ b/commands.go @@ -89,6 +89,14 @@ func init() { Desc: "change your nickname", Handle: commandDoNick, }, + "OPER": { + AllowHome: true, + MinArgs: 2, + MaxArgs: 2, + Usage: "<username> <password>", + Desc: "log in to an operator account", + Handle: commandDoOper, + }, "MODE": { AllowHome: true, MaxArgs: maxArgsInfinite, @@ -420,6 +428,15 @@ func commandDoNick(app *App, args []string) (err error) { return } +func commandDoOper(app *App, args []string) (err error) { + s := app.CurrentSession() + if s == nil { + return errOffline + } + s.Oper(args[0], args[1]) + return +} + func commandDoMode(app *App, args []string) (err error) { _, target := app.win.CurrentBuffer() if len(args) > 0 && !strings.HasPrefix(args[0], "+") && !strings.HasPrefix(args[0], "-") { |