-
Notifications
You must be signed in to change notification settings - Fork 29
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
Fixed checks.has_permissions and checks._bot_has_permissions #6
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tandemdude
reviewed
Dec 2, 2020
tandemdude
approved these changes
Dec 2, 2020
tandemdude
added a commit
that referenced
this pull request
Dec 4, 2020
* Update release webhook * Refactor errors, add readthedocs config file and github actions * black and fix rtd.yml * Add master_doc to conf.py * fix readthedocs config file * fix readthedocs config file * Add master_doc to conf.py * Fix sphinx config file * update requirements * update requirements * Attempt to fix styling issues * Fix github actions * Black file * Fixed checks.has_permissions and checks._bot_has_permissions (#6) * Fixed checks.has_permissions * Bump pytest from 6.1.1 to 6.1.2 Bumps [pytest](https://github.com/pytest-dev/pytest) from 6.1.1 to 6.1.2. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst) - [Commits](pytest-dev/pytest@6.1.1...6.1.2) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * Bump pytest-randomly from 3.4.1 to 3.5.0 Bumps [pytest-randomly](https://github.com/pytest-dev/pytest-randomly) from 3.4.1 to 3.5.0. - [Release notes](https://github.com/pytest-dev/pytest-randomly/releases) - [Changelog](https://github.com/pytest-dev/pytest-randomly/blob/master/HISTORY.rst) - [Commits](pytest-dev/pytest-randomly@3.4.1...3.5.0) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * Update hikari requirement from ~=2.0.0.dev91 to ~=2.0.0.dev95 Updates the requirements on [hikari](https://github.com/hikari-py/hikari) to permit the latest version. - [Release notes](https://github.com/hikari-py/hikari/releases) - [Commits](hikari-py/hikari@2.0.0.dev91...2.0.0.dev95) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * Added github templates, dependabot and cleanup * Remove unused import and whitespace * Bump pytest-testdox from 2.0.0 to 2.0.1 Bumps [pytest-testdox](https://github.com/renanivo/pytest-testdox) from 2.0.0 to 2.0.1. - [Release notes](https://github.com/renanivo/pytest-testdox/releases) - [Commits](renanivo/pytest-testdox@2.0.0...2.0.1) Signed-off-by: dependabot[bot] <support@github.com> * Add deploy to actions * Fix deploy.yml * Update readme * Update hikari requirement from ~=2.0.0.dev95 to ~=2.0.0.dev96 Updates the requirements on [hikari](https://github.com/hikari-py/hikari) to permit the latest version. - [Release notes](https://github.com/hikari-py/hikari/releases) - [Commits](hikari-py/hikari@2.0.0.dev95...2.0.0.dev96) Signed-off-by: dependabot[bot] <support@github.com> * Update changelog, version number and release webhook * Add twine username and pass to deploy env Co-authored-by: K.M Ahnaf Zamil <57180217+ahnaf-zamil@users.noreply.github.com> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> Co-authored-by: davfsa <davfsa@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
tandemdude
pushed a commit
that referenced
this pull request
Jan 1, 2021
* Fixed checks.has_permissions
tandemdude
added a commit
that referenced
this pull request
Jan 1, 2021
* Refactor errors, add readthedocs config file and github actions * fix readthedocs config file * Fixed checks.has_permissions and checks._bot_has_permissions (#6) * Fixed checks.has_permissions * Remove unused import and whitespace * Add missing_args to NotEnoughArguments and fix iter method for WrappedArg * Document using different logging levels with `logs` (#14) * Bump mock from 4.0.2 to 4.0.3 (#15) Bumps [mock](https://github.com/testing-cabal/mock) from 4.0.2 to 4.0.3. - [Release notes](https://github.com/testing-cabal/mock/releases) - [Changelog](https://github.com/testing-cabal/mock/blob/master/CHANGELOG.rst) - [Commits](testing-cabal/mock@4.0.2...4.0.3) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update hikari requirement from ~=2.0.0.dev96 to ~=2.0.0.dev97 (#16) Updates the requirements on [hikari](https://github.com/hikari-py/hikari) to permit the latest version. - [Release notes](https://github.com/hikari-py/hikari/releases) - [Commits](hikari-py/hikari@2.0.0.dev96...2.0.0.dev97) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update project url * Run black * Bump pytest from 6.1.2 to 6.2.1 (#18) Bumps [pytest](https://github.com/pytest-dev/pytest) from 6.1.2 to 6.2.1. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst) - [Commits](pytest-dev/pytest@6.1.2...6.2.1) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Allow get_command to find subcommands without having to call cmd.get_subcommand explicitly * Fix custom help example (#21) * Update copyright year, changelog and version number Co-authored-by: K.M Ahnaf Zamil <57180217+ahnaf-zamil@users.noreply.github.com> Co-authored-by: davfsa <davfsa@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: lachlan <lachlan_goh@hotmail.com>
tandemdude
pushed a commit
that referenced
this pull request
Jan 15, 2021
* Fixed checks.has_permissions
tandemdude
added a commit
that referenced
this pull request
Jan 15, 2021
* Fixed checks.has_permissions and checks._bot_has_permissions (#6) * Fixed checks.has_permissions * Remove unused import and whitespace * Add missing_args to NotEnoughArguments and fix iter method for WrappedArg * Run black * Fix `_human_only` check to not allow webhooks and webhook_only check (#23) * Fix IndexError when no command is provided. Fixes #24 * Temp fix human_only check * Fix walk_commands behaviour * Update sphinx requirement from ~=3.3.1 to ~=3.4.2 (#26) Updates the requirements on [sphinx](https://github.com/sphinx-doc/sphinx) to permit the latest version. - [Release notes](https://github.com/sphinx-doc/sphinx/releases) - [Changelog](https://github.com/sphinx-doc/sphinx/blob/3.x/CHANGES) - [Commits](sphinx-doc/sphinx@v3.3.1...v3.4.2) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Fixed role converter not converting a role mention (#29) closes #28 * Update changelog and version number * Update usages of Message.reply to be Message.respond * Update changelog Co-authored-by: K.M Ahnaf Zamil <57180217+ahnaf-zamil@users.noreply.github.com> Co-authored-by: davfsa <davfsa@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Yoda <64033043+YodaPY@users.noreply.github.com>
tandemdude
pushed a commit
that referenced
this pull request
Feb 17, 2021
* Fixed checks.has_permissions
tandemdude
pushed a commit
that referenced
this pull request
Feb 17, 2021
* Fixed checks.has_permissions
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pr fixes two bugs on the command checks. Before, the
has_permissions
check used to add the_bot_has_guild_permissions
instead of_has_guild_permissions
. So this would raise an error saying that the bot didn't have the perms while it was the command invoker who lacked the required perms.The second fix was on the
_bot_has_permissions
check. Before, it would raise the missing permissions error with the messageYou are missing one or more permissions required to run this command
instead ofI am missing one or more permissions required to run this command
since it's the bot who lacks the required perms.I have run nox and all the tests have passed.