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 Red specific app command check decorators #6400

Open
wants to merge 7 commits into
base: V3/develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@
- redbot/core/app_commands/*
# Docs
- docs/framework_app_commands.rst
- docs/framework_checks_app_commands.rst
# Tests
- tests/core/test_app_commands.py
"Category: Core - API - Commands Package":
Expand Down
2 changes: 1 addition & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@ Additions
- **Core - Commands Package** - Added `RawUserIdConverter` (:issue:`4486`)
- |cool| **Core - Commands Package** - Added support for hybrid commands (:issue:`5681`)
- **Core - Commands Package** - Added `positive_int` and `finite_float` converters (:issue:`5939`, :issue:`5969`)
- **Core - Commands Package** - Added new checks for proper permission resolution in both channels and threads: `bot_can_manage_channel()`, `bot_can_react()`, `can_manage_channel()`, `guildowner_or_can_manage_channel()`, `admin_or_can_manage_channel()`, `mod_or_can_manage_channel()` (:issue:`5600`)
- **Core - Commands Package** - Added new checks for proper permission resolution in both channels and threads: `redbot.core.commands.bot_can_manage_channel()`, `redbot.core.commands.bot_can_react()`, `redbot.core.commands.can_manage_channel()`, `redbot.core.commands.guildowner_or_can_manage_channel()`, `redbot.core.commands.admin_or_can_manage_channel()`, `redbot.core.commands.mod_or_can_manage_channel()` (:issue:`5600`)
- **Core - Dependencies** - Added ``red_commons`` as a dependency (:issue:`5624`)
- **Core - Modlog** - Added `Case.parent_channel` and `Case.parent_channel_id` (support for threads) (:issue:`5600`)
- **Core - Utils Package** - Added `SimpleMenu`, a template view subclass (:issue:`5634`)
Expand Down
11 changes: 11 additions & 0 deletions docs/framework_checks_app_commands.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.. _checks_app_commands:

============================
App Command Check Decorators
============================

The following are all decorators for app commands, which add restrictions to where and when they can be
run.

.. automodule:: redbot.core.app_commands.checks
:members:
7 changes: 4 additions & 3 deletions docs/incompatible_changes/3.5.rst
Original file line number Diff line number Diff line change
Expand Up @@ -469,9 +469,10 @@ To help support some of the newer features, we've also added a few things:
- Utilities that allow to **properly** check whether a member can do something in threads (or channels)
for cases where it isn't as simple as checking permissions:

- Command check decorators: `bot_can_manage_channel()`, `bot_can_react()`
- Permission check decorators: `can_manage_channel()`, `guildowner_or_can_manage_channel()`,
`admin_or_can_manage_channel()`, `mod_or_can_manage_channel()`
- Command check decorators: `redbot.core.commands.bot_can_manage_channel()`, `redbot.core.commands.bot_can_react()`
- Permission check decorators: `redbot.core.commands.can_manage_channel()`,
`redbot.core.commands.guildowner_or_can_manage_channel()`, `redbot.core.commands.admin_or_can_manage_channel()`,
`redbot.core.commands.mod_or_can_manage_channel()`
- Functions: `can_user_send_messages_in()`, `can_user_manage_channel()`, `can_user_react_in()`

- New module (`redbot.core.utils.views`) with useful `discord.ui.View` subclasses
Expand Down
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ Welcome to Red - Discord Bot's documentation!
framework_bank
framework_bot
framework_checks
framework_checks_app_commands
framework_commands
framework_app_commands
framework_config
Expand Down
Loading
Loading