From: Carl Worth Date: Fri, 1 Jan 2021 06:01:00 +0000 (-0800) Subject: Make /solved reject a missing solution string X-Git-Url: https://git.cworth.org/git?p=turbot;a=commitdiff_plain;h=8bfdfeb7e02851ac34d1933b8d4311964e562b0d Make /solved reject a missing solution string And instead give an error to the user explaining the usage of the /solved command. --- diff --git a/turbot/interaction.py b/turbot/interaction.py index bb0a8db..76eb061 100644 --- a/turbot/interaction.py +++ b/turbot/interaction.py @@ -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)