From f99b7ce923523047227fb3d0a5e32631e3439a11 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Fri, 27 Jan 2023 23:43:08 +0200 Subject: [PATCH] Add subcommand descriptions for guilds command. Fixes #19 --- commands.go | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/commands.go b/commands.go index 2a22aef..f68abf3 100644 --- a/commands.go +++ b/commands.go @@ -307,20 +307,33 @@ var cmdGuilds = &commands.FullHandler{ RequiresLogin: true, } +const smallGuildsHelp = "**Usage**: `$cmdprefix guilds [guild ID] [--entire]`" + +const fullGuildsHelp = smallGuildsHelp + ` + +* **help** - View this help message. +* **status** - View the list of guilds and their bridging status. +* **bridge <_guild ID_> [--entire]** - Enable bridging for a guild. The --entire flag auto-creates portals for all channels. +* **unbridge <_guild ID_>** - Unbridge a guild and delete all channel portal rooms.` + func fnGuilds(ce *WrappedCommandEvent) { if len(ce.Args) == 0 { - ce.Reply("**Usage**: `$cmdprefix guilds [guild ID] [--entire]`") + ce.Reply(fullGuildsHelp) return } subcommand := strings.ToLower(ce.Args[0]) ce.Args = ce.Args[1:] switch subcommand { - case "status": + case "status", "list": fnListGuilds(ce) case "bridge": fnBridgeGuild(ce) - case "unbridge": + case "unbridge", "delete": fnUnbridgeGuild(ce) + case "help": + ce.Reply(fullGuildsHelp) + default: + ce.Reply("Unknown subcommand `%s`\n\n"+smallGuildsHelp, subcommand) } }