summaryrefslogtreecommitdiff
path: root/commands.go
diff options
context:
space:
mode:
authorAlexey Yerin <yyp@disroot.org>2021-05-18 21:25:17 +0300
committerHubert Hirtz <hubert@hirtz.pm>2021-05-18 21:26:23 +0200
commitcdab4b7448e8425853beaee5087c51da5040c8cb (patch)
treea79e6a1614efc443f9df0c9980624d1b474986dc /commands.go
parentAdd /nick (diff)
Add /mode command
Diffstat (limited to 'commands.go')
-rw-r--r--commands.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/commands.go b/commands.go
index 9bf2f13..ee4274c 100644
--- a/commands.go
+++ b/commands.go
@@ -72,6 +72,14 @@ func init() {
Desc: "change your nickname",
Handle: commandDoNick,
},
+ "MODE": {
+ AllowHome: true,
+ MinArgs: 2,
+ MaxArgs: 5, // <channel> <flags> <limit> <user> <ban mask>
+ Usage: "<nick/channel> <flags> [args]",
+ Desc: "change channel or user modes",
+ Handle: commandDoMode,
+ },
"PART": {
AllowHome: true,
MaxArgs: 2,
@@ -267,6 +275,15 @@ func commandDoNick(app *App, buffer string, args []string) (err error) {
return
}
+func commandDoMode(app *App, buffer string, args []string) (err error) {
+ channel := args[0]
+ flags := args[1]
+ mode_args := args[2:]
+
+ app.s.ChangeMode(channel, flags, mode_args)
+ return
+}
+
func commandDoPart(app *App, buffer string, args []string) (err error) {
channel := buffer
reason := ""