Conversation
I have limited it to 5 for now in case of valid scenarios where 3 or 4 people are mentioned for a valid reason.
futaba/cogs/moderation/core.py
Outdated
| :return: Nothing. | ||
| """ | ||
| if len(message.mentions) > 5: | ||
| await self.perform_jail_internal(message, message.author, 0, "Mention Bombing.") |
There was a problem hiding this comment.
is there any reason this needs to take message.author separately?
There was a problem hiding this comment.
I thought that it would break perform_jail where it passes in a specific member into it if I did it that way. I probably could have it where if None is passed in that 2nd param that it would default to message.author though if needed.
| :param message: Messages. | ||
| :return: Nothing. | ||
| """ | ||
| if len(message.mentions) > 5: |
There was a problem hiding this comment.
On another thought I probably should ensure that this line does not count the same mention more than once like for example if they did @sameperson @sameperson @sameperson more than once.
But then again it could be considered annoying too so probably should dunce them too in that case as well.
Edit: Or even the case where they mention themselves multiple times too.
| raise CommandFailed(content="No configured jail role") | ||
|
|
||
| if member.top_role >= ctx.me.top_role: | ||
| if member.top_role >= self.bot.user.top_role: |
There was a problem hiding this comment.
Users do not have roles. ctx.me is the Member version of the bot, which is associated with a guild and does have rules.
There was a problem hiding this comment.
Is there a way to get the Member version of the bot without using ctx since it would be impossible to use ctx in on_message?
| :param message: Messages. | ||
| :return: Nothing. | ||
| """ | ||
| if len(message.mentions) > 5: |
There was a problem hiding this comment.
I think this is too simplistic. In addition to the self-mentioning problem above, this also doesn't account for multiple messages in quick succession with multiple mentions.
Finally, if we have a threshold like this it should be configurable per-guild.
There was a problem hiding this comment.
Alright I might need to look further into what you do to store the configuration, also might need to somehow store a datetime of the user's last mention like this as well so that way it can pick up any and all history on that action they done?
I have limited it to 5 for now in case of valid scenarios where 3 or 4 people are mentioned for a valid reason.
See also #325.