[Mod] Account for duplicated mentions (#4359)

* Account for duplicated mentions

* Spelling fix + Wording change

* Requested changes *hopefully*

* forgot to formattttttttttttttttttttttt

* Improve the consistency with existing commands in inconsistent `[p]modset` group

* What was the point of defining `guild` if you didn't end up using it, Jack!?

* I hate you, web editor ಠ益ಠ

* You could have just copy-pasted this Jack, seriously...

Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
This commit is contained in:
Sharky
2020-09-27 19:27:53 -06:00
committed by GitHub
parent 284080ec83
commit 3699c246df
3 changed files with 43 additions and 5 deletions

View File

@@ -45,7 +45,11 @@ class Events(MixinMeta):
guild, author = message.guild, message.author
mention_spam = await self.config.guild(guild).mention_spam.all()
mentions = set(message.mentions)
if mention_spam["strict"]: # if strict is enabled
mentions = message.raw_mentions
else: # if not enabled
mentions = set(message.mentions)
if mention_spam["ban"]:
if len(mentions) >= mention_spam["ban"]:
try: