Implement Application Command Permissions models

This commit is contained in:
Soheab
2022-06-07 07:35:33 +02:00
committed by GitHub
parent 4e7529138c
commit 3aa55ba1ed
6 changed files with 217 additions and 87 deletions

View File

@@ -3528,13 +3528,9 @@ AuditLogDiff
.. attribute:: app_command_permissions
A list of application command permission tuples that represents a
target and a :class:`bool` for said target.
The permissions of the app command.
The first element is the object being targeted, which can either
be a :class:`Member`, :class:`abc.GuildChannel`,
:class:`~discord.app_commands.AllChannels`, or :class:`Role`.
:type: List[Tuple[target, :class:`bool`]]
:type: :class:`~discord.app_commands.AppCommandPermissions`
.. this is currently missing the following keys: reason and application_id
I'm not sure how to about porting these

View File

@@ -121,6 +121,22 @@ AppCommandThread
.. autoclass:: discord.app_commands.AppCommandThread()
:members:
AppCommandPermissions
~~~~~~~~~~~~~~~~~~~~~~
.. attributetable:: discord.app_commands.AppCommandPermissions
.. autoclass:: discord.app_commands.AppCommandPermissions()
:members:
GuildAppCommandPermissions
~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. attributetable:: discord.app_commands.GuildAppCommandPermissions
.. autoclass:: discord.app_commands.GuildAppCommandPermissions()
:members:
Argument
~~~~~~~~~~
@@ -360,6 +376,22 @@ Enumerations
A message context menu command.
.. class:: AppCommandPermissionType
The application command's permission type.
.. versionadded:: 2.0
.. attribute:: role
The permission is for a role.
.. attribute:: channel
The permission is for one or all channels.
.. attribute:: user
The permission is for a user.
.. _discord_ui_kit:
Bot UI Kit