Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to auto jail mention bombers. #351

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

AraHaan
Copy link
Member

@AraHaan AraHaan commented May 26, 2020

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.

I have limited it to 5 for now in case of valid scenarios where 3 or 4 people are mentioned for a valid reason.
:return: Nothing.
"""
if len(message.mentions) > 5:
await self.perform_jail_internal(message, message.author, 0, "Mention Bombing.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there any reason this needs to take message.author separately?

Copy link
Member Author

@AraHaan AraHaan May 26, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member

@Ma-wa-re Ma-wa-re left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👓

futaba/cogs/moderation/core.py Outdated Show resolved Hide resolved
futaba/cogs/moderation/core.py Outdated Show resolved Hide resolved
@AraHaan AraHaan requested a review from Ma-wa-re May 26, 2020 23:59
:param message: Messages.
:return: Nothing.
"""
if len(message.mentions) > 5:
Copy link
Member Author

@AraHaan AraHaan May 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

futaba/cogs/moderation/core.py Outdated Show resolved Hide resolved
if roles.jail is None:
raise CommandFailed(content="No configured jail role")

if member.top_role >= ctx.me.top_role:
if member.top_role >= self.bot.user.top_role:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Users do not have roles. ctx.me is the Member version of the bot, which is associated with a guild and does have rules.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

futaba/cogs/moderation/core.py Outdated Show resolved Hide resolved
:param message: Messages.
:return: Nothing.
"""
if len(message.mentions) > 5:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Function to automatically dunce a user after pinging a large amount of users in a short time
4 participants