mirror of
https://github.com/stijndcl/didier.git
synced 2026-05-17 03:05:47 +02:00
Check react count before adding reactions, catches an exception
Fixes #32
This commit is contained in:
parent
09f61237a2
commit
6c08a84bd0
1 changed files with 4 additions and 0 deletions
|
|
@ -3,6 +3,10 @@ def check(content, earlier=[]):
|
||||||
if len(content) < 1:
|
if len(content) < 1:
|
||||||
return False, ["Controleer je argumenten."]
|
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
|
# This command should work case insensitive
|
||||||
for i, word in enumerate(content):
|
for i, word in enumerate(content):
|
||||||
content[i] = word.lower()
|
content[i] = word.lower()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue