Check react count before adding reactions, catches an exception

Fixes #32
pull/36/head
Stijn De Clercq 2021-02-08 20:38:26 +01:00
parent 09f61237a2
commit 6c08a84bd0
1 changed files with 4 additions and 0 deletions

View File

@ -3,6 +3,10 @@ def check(content, earlier=[]):
if len(content) < 1:
return False, ["Controleer je argumenten."]
# More than 20 reacts queried
if len(" ".join(content)) + len(earlier) > 20:
return False, ["Er kunnen maximaal 20 emoji's op een message geplaatst worden."]
# This command should work case insensitive
for i, word in enumerate(content):
content[i] = word.lower()