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

Implement application command permissions v2 #1183

Merged
merged 45 commits into from
May 5, 2022
Merged
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
f0748e6
Remove v1 from application commands
Dorukyum Jan 15, 2022
4488210
Remove permissions v1 from documentation
Dorukyum Jan 15, 2022
291203c
Add v2 attributes to commands
Dorukyum Jan 15, 2022
6410974
Fix permissions for groups
Dorukyum Jan 15, 2022
0cc48ac
Use v2 in as_dict methods
Dorukyum Jan 15, 2022
abb059a
Add new permission decorator
Dorukyum Jan 15, 2022
7ca7fbf
Add missing return
Dorukyum Jan 16, 2022
feed5fe
Allow both kwargs and decorators for permissions
Dorukyum Jan 16, 2022
c07242c
Add guild_only decorator
Dorukyum Jan 16, 2022
5844e94
Allow decorating a command
Dorukyum Jan 16, 2022
c0200a0
Merge branch 'master' of https://github.com/Pycord-Development/pycord…
Dorukyum Feb 5, 2022
3853bcc
Merge branch 'master' into permissions-v2
Dorukyum Mar 7, 2022
362a282
Remove permissions v1 from docs
Dorukyum Mar 7, 2022
71c67d3
Merge branch 'master' into permissions-v2
BobDotCom Mar 19, 2022
5a19868
Merge pull request #1129 from Dorukyum/permissions-v2
BobDotCom Mar 19, 2022
8fd19d9
Fix to_check in get_desynced_commands
BobDotCom Mar 19, 2022
ea7b3af
Merge branch 'master' into permissions-v2
BobDotCom Mar 22, 2022
4b319a8
Merge branch 'master' into permissions-v2
Dorukyum Mar 24, 2022
65ae1b4
Merge branch 'master' into permissions-v2
BobDotCom Apr 2, 2022
6ac81a1
Merge branch 'master' into permissions-v2
BobDotCom Apr 3, 2022
a836b62
Merge branch 'master' into permissions-v2
BobDotCom Apr 4, 2022
483a9aa
Merge branch 'master' into permissions-v2
BobDotCom Apr 5, 2022
4b58e83
Merge branch 'master' into permissions-v2
krittick Apr 27, 2022
258eeab
merge master into permissions-v2
krittick Apr 27, 2022
a6fbe73
Merge branch 'master' into permissions-v2
krittick Apr 28, 2022
e209f21
Merge branch 'master' into permissions-v2
BobDotCom Apr 28, 2022
5e11a6a
Rename has_permissions to default_permissions
BobDotCom Apr 28, 2022
b4879ee
Document command permissions
BobDotCom Apr 28, 2022
238ea15
Fix command permissions doc note
BobDotCom Apr 28, 2022
c40ed9d
Remove note
BobDotCom Apr 28, 2022
bf1c3f2
Rename dm_permission to guild_only for parity
BobDotCom Apr 28, 2022
16e9f6c
Fix imports
BobDotCom Apr 28, 2022
9847a42
Fix kwarg name
BobDotCom Apr 28, 2022
b085c6d
Merge branch 'master' into permissions-v2
BobDotCom Apr 28, 2022
70fe0fe
Move permission attributes to parent class
Dorukyum Apr 30, 2022
1eb9aab
Fix guild_only decorator
Dorukyum Apr 30, 2022
28fb2f6
Merge branch 'master' into permissions-v2
Lulalaby May 2, 2022
bcfd8ce
[Perms v2] Additional implementations (#1303)
plun1331 May 3, 2022
f8f0e6b
Merge branch 'master' into permissions-v2
Lulalaby May 5, 2022
81801b6
Update discord/commands/core.py
Lulalaby May 5, 2022
8ae253f
Merge branch 'master' into permissions-v2
Lulalaby May 5, 2022
e3f8203
Reduce need for Permissions TypeVar
TurnrDev May 5, 2022
5249f90
Update api.rst
plun1331 May 5, 2022
dfb9e2b
Merge branch 'master' into permissions-v2
krittick May 5, 2022
30582bc
Merge branch 'master' into permissions-v2
krittick May 5, 2022
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
6 changes: 3 additions & 3 deletions discord/commands/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1624,9 +1624,9 @@ def validate_chat_input_name(name: Any, locale: Optional[str] = None):
f"Locale '{locale}' is not a valid locale, " f"see {docs}/reference#locales for list of supported locales."
Lulalaby marked this conversation as resolved.
Show resolved Hide resolved
)
error = None
if not isinstance(name, str):
error = TypeError(f'Command names and options must be of type str. Received "{name}"')
elif not re.match(r"^[\w-]{1,32}$", name):
if not isinstance(name, str): not re.match(r"^[\w-]{1,32}$", name):
Lulalaby marked this conversation as resolved.
Show resolved Hide resolved
error = TypeError(f"Command names and options must be of type str. Received \"{name}\"")
elif not re.match(r"^[-_\w\d\u0901-\u097D\u0E00-\u0E7F]{1,32}$", name):
error = ValidationError(
r"Command names and options must follow the regex \"^[-_\w\d\u0901-\u097D\u0E00-\u0E7F]{1,32}$\". For more information, see "
f"{docs}/interactions/application-commands#application-command-object-application-command-naming. "
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.