aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar scragly <[email protected]>2020-03-09 17:27:30 +1000
committerGravatar scragly <[email protected]>2020-03-09 17:31:53 +1000
commit49dd708625a7edff567efbd538abf4c170d59393 (patch)
treedbcfa3ef42243b1274931fb29672bd50de12b19a
parentMerge branch 'master' into vote (diff)
Check lower bound for vote options.
If the vote command receives less than 2 options, it's not being used for it's intended usage and is considered a user input error.
-rw-r--r--bot/cogs/utils.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/bot/cogs/utils.py b/bot/cogs/utils.py
index c5eaa547b..2003eb350 100644
--- a/bot/cogs/utils.py
+++ b/bot/cogs/utils.py
@@ -266,6 +266,8 @@ class Utils(Cog):
A maximum of 20 options can be provided, as Discord supports a max of 20
reactions on a single message.
"""
+ if len(options) < 2:
+ raise BadArgument("Please provide at least 2 options.")
if len(options) > 20:
raise BadArgument("I can only handle 20 options!")