3 Here is an overview of commands that Turbot makes available. You can
4 actually get at all functionality by just typing `/hunt` and then
5 clicking buttons that are provided in the result. But many operations
6 will be much more efficient by using a special-purpose command, (such
7 as `/solved SOLUTION`).
9 Type `/help <command-name>` for more details on any command below.
11 *Hunt creation and editing*
12 `/new [hunt]`: Create a new hunt (from any channel)
13 `/edit [hunt]`: Edit the current hunt (in a hunt or puzzle channel)
15 *Puzzle creation and editing* (in a puzzle channel unless specified)
16 `/new [puzzle]`: Create a new puzzle (in a hunt or puzzle channel)
17 `/edit [puzzle]`: Edit the current puzzle
18 `/state <update>`: Capture the current state
19 `/solved <solution>`: Mark current puzzle solved
20 `/tag [+ADD_TAG|-REMOVE_TAG]`: Tag/untag current puzzle
22 *Hunt overview and searching for puzzles*
23 `/hunt <search_terms>`: Search for puzzles (in a hunt/puzzle channel)
24 `/round <search_terms>`: Show puzzles in current round (puzzle channel)
25 `/puzzle`: Display state of current puzzle (puzzle channel)
27 *Solving support* (from any channel)
28 `/help me`: Get a suggestion of something to try
29 `/rot [*|COUNT] <text_to_rotate>`: Perform a Caesar shift on text
34 "summary": "Edit the puzzle or hunt for the current channel",
35 "usage": "`/edit`, `/edit hunt`, `/edit puzzle`",
36 "details": ("This command will bring up a dialog window where you " +
37 "can edit the current hunt or puzzle. With `/edit` " +
38 "alone it will edit whatever is associated with the " +
39 "current channel (hunt or puzzle). With `/edit hunt` " +
40 "you can edit the hunt from a puzzle channel.")
43 "summary": "Search for and display puzzles in the current hunt",
44 "usage": "`/hunt [unsolved|solved|all] [meta|plain] <search_terms>`",
45 "details": ("With `/hunt` alone, this command will display all " +
46 "unsolved puzzles in the current hunt. All output from " +
47 "`/hunt` is entirely private to you, so you do not need " +
48 "to worry about cluttering up the channel's chat " +
49 "traffic with this command." +
51 "The output for each puzzle will include all of the " +
52 "information displayed by the `/puzzle` command so see " +
53 "`/help puzzle` for details." +
55 "An initial argument can be used to instead display " +
56 "only `solved` puzzles or `all` puzzles (both unsolved " +
57 "and solved). Additional arguments are search terms. " +
58 "Only puzzles that match all provided terms will be " +
59 " displayed. The terms can match the puzzle title, " +
60 " round title, puzzle URL, puzzle type (`meta` or " +
61 "`plain`), tags, or a puzzle's solution." +
63 "Use quotation marks in search terms to search for a " +
64 "phrase such as `/hunt \"good times\"`." +
66 "Search terms can include regular expression syntax." +
68 "This command also supports `/hunt new` and " +
69 "`/hunt edit` which are identical to `/new hunt` " +
70 "and `/edit hunt` so see `/help new` or `/help edit`" +
74 "summary": "Create a new puzzle (or a new hunt)",
75 "usage": "`/new`, `/new puzzle`, `/new hunt`",
76 "details": ("With `/new` alone, this command will bring up a " +
77 "dialog window where you will be prompted for " +
78 "information to create a new puzzle. The only field " +
79 "required for a new puzzle is the puzzle's name " +
80 "but any additional information you have will be " +
81 "useful to add (such as an external URL for the puzzle.)" +
83 "A puzzle can be marked as a meta-puzzle and can be " +
84 "assigned to one or more rounds. If the round(s) for " +
85 "this puzzle already exist, simply click on them in " +
86 "the \"Round(s)\" field. If this is the first puzzle " +
87 "for a new round, then type the name of the round in " +
88 "the \"New round(s)\" field." +
90 "For the new puzzle, Turbot will create a Slack channel " +
91 "and a shared spreadsheet for the puzzle. It will also " +
92 "announce the new puzzle in the hunt's channel, where " +
93 "members of the hunt can click to join the puzzle's " +
94 "channel and then click through to the puzzle's sheet." +
96 "This command can also be issued as `/new hunt` from " +
97 "any channel to create an entirely new hunt.")
100 "summary": "Display the status of the current puzzle",
101 "usage": "`/puzzle`, `/puzzle new`, `/puzzle edit",
102 "details": ("When you issue `/puzzle` alone in a puzzle channel, " +
103 "Turbot will reply (privately to you) with all the " +
104 "information it has about the current puzzle. For all " +
105 "puzzles this includes the solved status (either an " +
106 "unchecked or checked checkbox), the puzzle title, " +
107 "links to the puzzle's external web page and sheet, " +
108 "the rounds of the puzzle, and tags, and the puzzle's " +
111 "If this is a meta-puzzle the output will also include " +
112 "the names (and solutions where known) of all other " +
113 "puzzles in the same round as the current puzzle." +
115 "This command also support `/puzzle new` and " +
116 "`/puzzle edit` which are identical to `/new puzzle` " +
117 "and `/edit puzzle` so see `/help new` and `/help edit` " +
121 "summary": "Display puzzles in the same round as the current puzzle",
122 "usage": "`/round [unsolved|solved|all] [meta|plain] <search_terms>`",
123 "details": ("The `/round` command can be issued from any puzzle " +
124 "channel and will display (by default) all puzzles " +
125 "belonging to the same round(s) as the current puzzle." +
127 "To filter to only solved or unsolved puzzles, issue " +
128 "`/round solved` or `/round unsolved` instead." +
130 "This command also supports all of the same options as " +
131 "the `/hunt` command for searching/filtering which " +
132 "puzzles to display. So see `/help hunt` for details.")
135 "summary": "Perform a Caesar shift rotation on some text",
136 "usage": "`/rot TEXT`, `/rot * TEXT`, `/rot COUNT TEXT`",
137 "details": ("This command performs a Caesar shift rotation on the " +
138 "text you provide to the command. An initial numeric " +
139 "argument indicates how many places through the " +
140 "alphabet each character should be rotated." +
142 "If the numeric argument is omitted, or is the " +
143 "character `*` this command will emit every possible " +
144 "rotation of the provided text." +
146 "Note: Unlike commands such as `/hunt` or `/puzzle` the " +
147 "output from `/rot` will be presented to the current " +
148 "channel rather than privately to you. The idea behind " +
149 "this is that others working on the same puzzle might " +
150 "benefit from this output as well." +
152 "If you would like to execute this command privately, " +
153 "may issue it in a direct-message conversation with " +
157 "summary": "Updates the state of this puzzle",
158 "usage": "`/state <WHERE THINGS STAND>`",
159 "details": ("This command allows you to capture a high-level " +
160 "description of the state of a puzzle. This is " +
161 "particularly useful when you are switching away from " +
162 "a puzzle to let the next solvers know the state of " +
165 "Turbot will present the state string in every view it " +
166 "generates for the puzzle." +
168 "An example state string might be something like: " +
169 "`/state Grid is filled, but we need help on extraction`" +
173 "summary": "Record the solution of a puzzle",
174 "usage": "`/solved SOLUTION HERE`",
175 "details": ("Once you've submitted a solution to the hunt's website " +
176 "and it has been confirmed, issue the `/solved` command " +
177 "so that Turbot knows the puzzle is solved. Turbot will " +
178 "report to the hunt's channel that the puzzle has been " +
182 "summary": "Add or remove a tag to a puzzle",
183 "usage": "`/tag NEW_TAG`",
184 "details": ("This command allows you to add brief descriptive tags " +
185 "to a puzzle. This might include puzzle types, specific " +
186 "domain knowledge, or metadata from the puzzle’s " +
187 "presentation which might be used elsewhere." +
189 "Tags can only consist of letters, numbers, and the " +
190 "underscore character `_`." +
192 "You can also add a tag by typing `/tag +TAG_TO_ADD` " +
193 "and remove a tag with `/tag -TAG_TO_REMOVE`.")
197 def turbot_help(args):
198 """The top-level implementation of the Turbot help system
200 With empty args, gives a summary of available commands.
202 With any command name, gives detailed help on that command.
208 # We only look at the first word here
209 command = args.split(" ", 1)[0]
211 # Ignore any slash prefix the user may have given
212 if command[0] == '/':
213 command = command[1:]
215 if command not in commands:
216 valid = list(commands.keys())
218 return "Unknown command: {}. Valid commands are: {}".format(
219 command, ", ".join(valid))
221 dict = commands[command]
222 return ("*Help on `/{}`*".format(command) +
223 "\n`/{}`: {}".format(command, dict["summary"]) +
224 "\nUsage: {}".format(dict["usage"]) +
225 "\n\n{}".format(dict["details"]))