Add subcommand descriptions for guilds command. Fixes #19
This commit is contained in:
19
commands.go
19
commands.go
@@ -307,20 +307,33 @@ var cmdGuilds = &commands.FullHandler{
|
|||||||
RequiresLogin: true,
|
RequiresLogin: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const smallGuildsHelp = "**Usage**: `$cmdprefix guilds <help/status/bridge/unbridge> [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) {
|
func fnGuilds(ce *WrappedCommandEvent) {
|
||||||
if len(ce.Args) == 0 {
|
if len(ce.Args) == 0 {
|
||||||
ce.Reply("**Usage**: `$cmdprefix guilds <status/bridge/unbridge> [guild ID] [--entire]`")
|
ce.Reply(fullGuildsHelp)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
subcommand := strings.ToLower(ce.Args[0])
|
subcommand := strings.ToLower(ce.Args[0])
|
||||||
ce.Args = ce.Args[1:]
|
ce.Args = ce.Args[1:]
|
||||||
switch subcommand {
|
switch subcommand {
|
||||||
case "status":
|
case "status", "list":
|
||||||
fnListGuilds(ce)
|
fnListGuilds(ce)
|
||||||
case "bridge":
|
case "bridge":
|
||||||
fnBridgeGuild(ce)
|
fnBridgeGuild(ce)
|
||||||
case "unbridge":
|
case "unbridge", "delete":
|
||||||
fnUnbridgeGuild(ce)
|
fnUnbridgeGuild(ce)
|
||||||
|
case "help":
|
||||||
|
ce.Reply(fullGuildsHelp)
|
||||||
|
default:
|
||||||
|
ce.Reply("Unknown subcommand `%s`\n\n"+smallGuildsHelp, subcommand)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user