Cog-Creators / Red-DiscordBot

A multi-function Discord bot
https://docs.discord.red
GNU General Public License v3.0
4.72k stars 2.3k forks source link

Add Red specific app command check decorators #6400

Open Flame442 opened 2 months ago

Flame442 commented 2 months ago

Description of the changes

Implements is_owner, guildowner, admin, mod, guildowner_or_permissions, admin_or_permissions, mod_or_permissions, can_manage_channel, admin_or_can_manage_channel, mod_or_can_manage_channel, bot_can_manage_channel, bot_can_react, and bot_in_a_guild.

Currently, this PR reimplements a lot of utils that were used in commands.requires, the source of Red specific text command checks, because of circular import issues and the fact that those versions generally rely on having a Context object. Not sure how fixable this is.

Docs: https://red-discordbot--6400.org.readthedocs.build/en/6400/framework_checks_app_commands.html

Closes #6017

Have the changes in this PR been tested?

Yes