]> git.cworth.org Git - turbot/commitdiff
Make /solved reject a missing solution string
authorCarl Worth <cworth@cworth.org>
Fri, 1 Jan 2021 06:01:00 +0000 (22:01 -0800)
committerCarl Worth <cworth@cworth.org>
Fri, 1 Jan 2021 06:01:00 +0000 (22:01 -0800)
And instead give an error to the user explaining the usage of the
/solved command.

turbot/interaction.py

index bb0a8db7947b1b0eafb515317230a901504099b8..76eb061d024a29475bc01a368ab67abd3b3e162f 100644 (file)
@@ -536,6 +536,10 @@ def solved(turb, body, args):
     if not puzzle:
         return bot_reply("Sorry, this is not a puzzle channel.")
 
+    if not args:
+        return bot_reply(
+            "Error, no solution provided. Usage: `/solved SOLUTION HERE`")
+
     # Set the status and solution fields in the database
     puzzle['status'] = 'solved'
     puzzle['solution'].append(args)