Closed KOOKIIEStudios closed 6 months ago
Describe the bug
To Reproduce Steps to reproduce the behavior:
/info
/online
Expected behavior Non-admins should not be allowed to use admin commands
Plausible explanations The way this is currently handled is the following in line 5 of main.py:
main.py
from discord.ext.commands import has_permissions
which is then consumed as a decorator for admin commands like so:
@has_permissions(administrator=True)
Based on the latest API docs for Interactions (which slash commands fall under) from discord.py, the way to check for permissions is to use this instead:
@app_commands.checks.has_permissions(administrator=True)
Note that we already import app_commands in line 4 of main.py:
app_commands
from discord import app_commands
This solution has been tested by the reporter of the bug. We'll just need to perform the refactoring to remote for this issue.
I would like to take this.
Assigned! Feel free to send a PR, i'd gladly review and approve
Issue fixed in #20
Thanks @alexraskin!
Describe the bug![initial report](https://github.com/KOOKIIEStudios/PalCON-Discord/assets/25145447/c544ce14-8048-40ab-a226-bd59181b650c)
To Reproduce Steps to reproduce the behavior:
/info
or/online
Expected behavior Non-admins should not be allowed to use admin commands
Plausible explanations The way this is currently handled is the following in line 5 of
main.py
:which is then consumed as a decorator for admin commands like so:
Based on the latest API docs for Interactions (which slash commands fall under) from discord.py, the way to check for permissions is to use this instead:
Note that we already import
app_commands
in line 4 ofmain.py
:This solution has been tested by the reporter of the bug. We'll just need to perform the refactoring to remote for this issue.![findings following investigation](https://github.com/KOOKIIEStudios/PalCON-Discord/assets/25145447/aac6a108-8044-41fc-90ef-2ec8e8411b6a)