Skip to content

Commit ef19ab1

Browse files
authored
Update permissions.py
1 parent 37200d8 commit ef19ab1

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

discord/commands/permissions.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,21 @@ def decorator(func: Callable):
105105
return decorator
106106

107107
def has_role(item: Union[int, str], guild_id: int = None):
108+
"""The method used to specify application command role restrictions.
109+
110+
This method is meant to be used as a decorator.
111+
112+
.. versionadded:: 2.0
113+
114+
Attributes
115+
-----------
116+
item: Union[:class:`int`, :class:`str`]
117+
An integer or string that represent the id or name of the role
118+
that the permission is tied to.
119+
guild_id: :class:`int`
120+
The integer which represents the id of the guild that the
121+
permission may be tied to.
122+
"""
108123
def decorator(func: Callable):
109124
# Create __app_cmd_perms__
110125
if not hasattr(func, '__app_cmd_perms__'):

0 commit comments

Comments
 (0)