Skip to content
This repository has been archived by the owner on Mar 8, 2022. It is now read-only.

Commit

Permalink
allow context commands to have names with spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
kvsxxx committed Sep 5, 2021
1 parent 0437e91 commit a8dada0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ You can find more (and better) examples [here](https://github.com/discord-py-ui/
- small SelectOption issues
- context commands

## **Changed**
- allow context commands to have names with spaces

</details>

- <details>
Expand Down
5 changes: 4 additions & 1 deletion discord_ui/slash/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,10 @@ def name(self, value):
raise WrongType("name", value, "str")
if len(value) > 32 or len(value) < 1:
raise InvalidLength("name", 1, 32)
self._json["name"] = format_name(value)
if self.command_type == CommandType.SLASH:
self._json["name"] = format_name(value)
else:
self._json["name"] = value
@property
def description(self) -> str:
"""The description of the command
Expand Down

0 comments on commit a8dada0

Please sign in to comment.