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

Add "always respect user permissions" field #91

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Chew
Copy link
Owner

@Chew Chew commented Aug 26, 2024

Pull Request

Pull Request Checklist

Please follow the following steps before opening this PR.

PRs that do not complete the checklist will be subject to denial for
missing information.

Pull Request Information

Check and fill in the blanks for all that apply:

  • My PR fixes a bug, error, or other issue with the library's codebase.
  • My PR is for the commands module of the JDA-Utilities library.
  • My PR creates a new module for the JDA-Utilities library: ______.

Description

This adds a field for interactions that allows the userPermissions checks to be skipped. They aren't necessary on servers because you can override them in the integration settings, and if left unset, the userPermissions set will take precedent anyway. The most breaking change is it's false by default, but no one will notice.

@Chew Chew added the enhancement New feature or request label Aug 26, 2024
* <br>
* This has no effect for text based commands or DMs.
*/
protected boolean alwaysRespectUserPermissions = false;

Choose a reason for hiding this comment

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

That's quite a mouth full... Maybe a shorter name could be better? Like forceUserPermissions, given that, from what I understand, this would force the bot to always check its user perms over server overrides?

continue;

if(p.isChannel())
if (alwaysRespectUserPermissions)

Choose a reason for hiding this comment

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

Given the size of the if-section here, this should probably be wrapped in {} for readability.

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

Successfully merging this pull request may close these issues.

2 participants