From: Carl Worth Date: Sat, 9 Jan 2021 12:27:35 +0000 (-0800) Subject: Add two new shortcut commands: X-Git-Url: https://git.cworth.org/git?p=turbot;a=commitdiff_plain;h=30846beeed5db3c857a19f75a91dc33c014c9204 Add two new shortcut commands: /new Which is the same as: /puzzle new /edit Which is the same as: /puzzle edit I don't know if this is cleaner or messier, but I can at least put it out there as an option. --- diff --git a/turbot/interaction.py b/turbot/interaction.py index 8bff8bc..7f93c04 100644 --- a/turbot/interaction.py +++ b/turbot/interaction.py @@ -81,6 +81,19 @@ def multi_static_select(turb, payload): actions['multi_static_select'] = {"*": multi_static_select} +def edit(turb, body, args): + """Implementation of the `/edit` command + + To edit the puzzle for the current channel. + + This is simply a shortcut for `/puzzle edit`. + """ + + return edit_puzzle_command(turb, body) + +commands["/edit"] = edit + + def edit_puzzle_command(turb, body): """Implementation of the `/puzzle edit` command @@ -696,6 +709,18 @@ def puzzle(turb, body, args): commands["/puzzle"] = puzzle +def new(turb, body, args): + """Implementation of the `/new` command + + To create a new puzzle. + + This is simply a shortcut for `/puzzle new`. + """ + + return new_puzzle(turb, body) + +commands["/new"] = new + def new_puzzle(turb, body): """Implementation of the "/puzzle new" command