]> git.cworth.org Git - turbot/commitdiff
Add two new shortcut commands:
authorCarl Worth <cworth@cworth.org>
Sat, 9 Jan 2021 12:27:35 +0000 (04:27 -0800)
committerCarl Worth <cworth@cworth.org>
Sat, 9 Jan 2021 12:31:46 +0000 (04:31 -0800)
/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

index 8bff8bc3cbc656571ca0a953a5002d9f7659ec3d..7f93c040ce8c4a5406adecf80104ab84c8e47d27 100644 (file)
@@ -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