Skip to content

Commit e94683a

Browse files
committed
Improve docs string for permissions.
1 parent 95faa16 commit e94683a

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

discord_slash/client.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ def add_slash_command(self,
441441
guild_ids: typing.List[int] = None,
442442
options: list = None,
443443
default_permission: bool = True,
444-
permissions: dict = None,
444+
permissions: typing.Dict[int, list] = None,
445445
connector: dict = None,
446446
has_subcommands: bool = False):
447447
"""
@@ -463,7 +463,7 @@ def add_slash_command(self,
463463
:type options: list
464464
:param default_permission: Sets if users have permission to run slash command by default, when no permissions are set. Default ``True``.
465465
:type default_permission: bool
466-
:param permissions: Permission requirements of the slash command. Default ``None``.
466+
:param permissions: Dictionary of permissions of the slash command. Key being target guild_id and value being a list of permissions to apply. Default ``None``.
467467
:type permissions: dict
468468
:param connector: Kwargs connector for the command. Default ``None``.
469469
:type connector: dict
@@ -510,7 +510,7 @@ def add_subcommand(self,
510510
description: str = None,
511511
base_description: str = None,
512512
base_default_permission: bool = True,
513-
base_permissions: dict = None,
513+
base_permissions: typing.Dict[int, list] = None,
514514
subcommand_group_description: str = None,
515515
guild_ids: typing.List[int] = None,
516516
options: list = None,
@@ -532,8 +532,8 @@ def add_subcommand(self,
532532
:type base_description: str
533533
:param default_permission: Sets if users have permission to run base command by default, when no permissions are set. Default ``True``.
534534
:type default_permission: bool
535-
:param permissions: Permission requirements of the base command. Default ``None``.
536-
:type permissions: dict
535+
:param base_permissions: Dictionary of permissions of the slash command. Key being target guild_id and value being a list of permissions to apply. Default ``None``.
536+
:type base_permissions: dict
537537
:param subcommand_group_description: Description of the subcommand_group. Default ``None``.
538538
:type subcommand_group_description: str
539539
:param guild_ids: List of guild ID of where the command will be used. Default ``None``, which will be global command.

discord_slash/cog_ext.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def cog_slash(*,
1010
guild_ids: typing.List[int] = None,
1111
options: typing.List[dict] = None,
1212
default_permission: bool = True,
13-
permissions: dict = None,
13+
permissions: typing.Dict[int, list] = None,
1414
connector: dict = None):
1515
"""
1616
Decorator for Cog to add slash command.\n
@@ -38,7 +38,7 @@ async def ping(self, ctx: SlashContext):
3838
:type options: List[dict]
3939
:param default_permission: Sets if users have permission to run slash command by default, when no permissions are set. Default ``True``.
4040
:type default_permission: bool
41-
:param permissions: Permission requirements of the slash command. Default ``None``.
41+
:param permissions: Dictionary of permissions of the slash command. Key being target guild_id and value being a list of permissions to apply. Default ``None``.
4242
:type permissions: dict
4343
:param connector: Kwargs connector for the command. Default ``None``.
4444
:type connector: dict
@@ -72,7 +72,7 @@ def cog_subcommand(*,
7272
base_description: str = None,
7373
base_desc: str = None,
7474
base_default_permission: bool = True,
75-
base_permissions: dict = None,
75+
base_permissions: typing.Dict[int, list] = None,
7676
subcommand_group_description: str = None,
7777
sub_group_desc: str = None,
7878
guild_ids: typing.List[int] = None,
@@ -107,7 +107,7 @@ async def group_say(self, ctx: SlashContext, text: str):
107107
:param base_desc: Alias of ``base_description``.
108108
:param base_default_permission: Sets if users have permission to run slash command by default, when no permissions are set. Default ``True``.
109109
:type base_default_permission: bool
110-
:param base_permissions: Permission requirements of the slash command. Default ``None``.
110+
:param base_permissions: Dictionary of permissions of the slash command. Key being target guild_id and value being a list of permissions to apply. Default ``None``.
111111
:type base_permissions: dict
112112
:param subcommand_group_description: Description of the subcommand_group. Default ``None``.
113113
:type subcommand_group_description: str

0 commit comments

Comments
 (0)