From 30846beeed5db3c857a19f75a91dc33c014c9204 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Sat, 9 Jan 2021 04:27:35 -0800 Subject: [PATCH] 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. --- turbot/interaction.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) 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 -- 2.43.0