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

fix pingable name listener #494

Merged
merged 2 commits into from
Nov 29, 2024
Merged

Conversation

danthe1st
Copy link
Member

@danthe1st danthe1st commented Aug 24, 2024

This PR changes the PingableNameListener (which never really worked before) in the following ways:

  • It only changes names of users if the bot has the permission to "interact" with the user (i.e. the bot roles are "above" the user) and not vice-versa.
  • Instead of requiring the first 3 characters to be in a alphanumeric range, it requires names to have at least 3 alphanumerical (including underscores) characters.
  • Logs are sent to the message log to not spam the moderation log.
  • The bot stops adding numbers at the end of generated names.

@danthe1st danthe1st requested a review from a team as a code owner August 24, 2024 07:50
@danthe1st
Copy link
Member Author

danthe1st commented Nov 23, 2024

It seems this is incompatible with disabling member caching in #502.

@danthe1st danthe1st marked this pull request as draft November 23, 2024 17:57
@danthe1st danthe1st marked this pull request as ready for review November 23, 2024 18:10
@danthe1st
Copy link
Member Author

To work without member caching (#502), I changed it to use onGuildMemberUpdate as onGuildMemberUpdateNickname requires the member to be cached.

@danthe1st danthe1st merged commit 85d8f7e into Java-Discord:main Nov 29, 2024
2 checks passed
@danthe1st danthe1st deleted the fix-rename branch November 29, 2024 09:05
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.

2 participants