diff options
author | Tulir Asokan <tulir@maunium.net> | 2019-03-30 18:51:26 +0200 |
---|---|---|
committer | Tulir Asokan <tulir@maunium.net> | 2019-03-30 18:51:32 +0200 |
commit | 535fbbb4f7703845bb25484f6eb67b1389f2dd61 (patch) | |
tree | 2eb44334b733d20c110ffb8b3218c8edd4c82852 /ui/commands.go | |
parent | a8dcdfbaa105039f36daa4e1544158346f3379e9 (diff) |
Change even more things
Diffstat (limited to 'ui/commands.go')
-rw-r--r-- | ui/commands.go | 40 |
1 files changed, 31 insertions, 9 deletions
diff --git a/ui/commands.go b/ui/commands.go index bba1644..bc07779 100644 --- a/ui/commands.go +++ b/ui/commands.go @@ -101,7 +101,29 @@ func cmdUnknownCommand(cmd *Command) { } func cmdHelp(cmd *Command) { - cmd.Reply("Known command. Don't try \"/help\" for help.") + cmd.Reply(`/help - Show the temporary help message. + +/quit - Quit gomuks. +/clearcache - Clear cache and quit gomuks. +/logout - Log out of Matrix. + +/me <message> - Send an emote message. +/rainbow <message> - Send a rainbow message (markdown not supported). + +/join <room address> - Join a room. +/leave - Leave the current room. + +/invite <user id> - Invite a user. +/kick <user id> [reason] - Kick a user. +/ban <user id> [reason] - Ban a user. +/unban <user id> - Unban a user. + +/send <room id> <type> <json> - Send a custom event to the given room. +/msend <type> <json> - Send a custom event to the current room. +/setstate <room id> <type> <key/-> <json> - Send a custom event to the given room. +/msetstate <type> <key/-> <json> - Send a custom event to the current room. + +/toggle <thing> - Temporary command to toggle various UI features.`) } func cmdLeave(cmd *Command) { @@ -126,14 +148,14 @@ func cmdInvite(cmd *Command) { func cmdBan(cmd *Command) { if len(cmd.Args) < 1 { - cmd.Reply("Usage: /ban <user> <optional:reason>") + cmd.Reply("Usage: /ban <user> [reason]") return } reason := "you are the weakest link, goodbye!" if len(cmd.Args) >= 2 { - reason = strings.Join(cmd.Args[1:]," ") + reason = strings.Join(cmd.Args[1:], " ") } - _, err := cmd.Matrix.Client().BanUser(cmd.Room.MxRoom().ID, &mautrix.ReqBanUser{reason,cmd.Args[0]}) + _, err := cmd.Matrix.Client().BanUser(cmd.Room.MxRoom().ID, &mautrix.ReqBanUser{reason, cmd.Args[0]}) if err != nil { debug.Print("Error in ban call:", err) cmd.Reply("Failed to ban user:", err) @@ -155,14 +177,14 @@ func cmdUnban(cmd *Command) { func cmdKick(cmd *Command) { if len(cmd.Args) < 1 { - cmd.Reply("Usage: /kick <user> <optional:reason>") + cmd.Reply("Usage: /kick <user> [reason]") return } reason := "you are the weakest link, goodbye!" if len(cmd.Args) >= 2 { - reason = strings.Join(cmd.Args[1:]," ") + reason = strings.Join(cmd.Args[1:], " ") } - _, err := cmd.Matrix.Client().KickUser(cmd.Room.MxRoom().ID, &mautrix.ReqKickUser{reason,cmd.Args[0]}) + _, err := cmd.Matrix.Client().KickUser(cmd.Room.MxRoom().ID, &mautrix.ReqKickUser{reason, cmd.Args[0]}) if err != nil { debug.Print("Error in kick call:", err) debug.Print("Failed to kick user:", err) @@ -192,7 +214,7 @@ func cmdMSendEvent(cmd *Command) { cmd.Reply("Usage: /msend <event type> <content>") return } - cmd.Args = append([]string{cmd.Room.MxRoom().ID},cmd.Args...) + cmd.Args = append([]string{cmd.Room.MxRoom().ID}, cmd.Args...) cmdSendEvent(cmd) } @@ -230,7 +252,7 @@ func cmdMSetState(cmd *Command) { cmd.Reply("Usage: /msetstate <event type> <state key> <content>") return } - cmd.Args = append([]string{cmd.Room.MxRoom().ID},cmd.Args...) + cmd.Args = append([]string{cmd.Room.MxRoom().ID}, cmd.Args...) cmdSetState(cmd) } |