diff options
author | 2019-03-24 13:42:47 -0400 | |
---|---|---|
committer | 2019-03-24 13:42:47 -0400 | |
commit | da8654e33e3e7d518e3d50a1744692428ca9c2c7 (patch) | |
tree | 863fbf136c6ba9d052b9f1821d45a356d779160e | |
parent | Change debug to info (diff) |
Use keyword-only arg, output usage if length requirement not met
-rw-r--r-- | bot/seasons/evergreen/magic_8ball.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/bot/seasons/evergreen/magic_8ball.py b/bot/seasons/evergreen/magic_8ball.py index a4e576f2..88c9fd26 100644 --- a/bot/seasons/evergreen/magic_8ball.py +++ b/bot/seasons/evergreen/magic_8ball.py @@ -19,13 +19,15 @@ class Magic8ball: self.answers = json.load(file) @commands.command(name="8ball") - async def output_answer(self, ctx, question: list): + async def output_answer(self, ctx, *, question): """ Return a magic 8 ball answer from answers list. """ - if len(question) >= 3: + if len(question.split()) >= 3: answer = random.choice(self.answers) await ctx.send(answer) + else: + await ctx.send("Usage: .8ball <question> (minimum length of 3 eg: `will I win?`)") # Required in order to load the cog, use the class name in the add_cog function. |