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

Commit a8dada0

Browse files
committed
allow context commands to have names with spaces
1 parent 0437e91 commit a8dada0

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,9 @@ You can find more (and better) examples [here](https://github.com/discord-py-ui/
183183
- small SelectOption issues
184184
- context commands
185185

186+
## **Changed**
187+
- allow context commands to have names with spaces
188+
186189
</details>
187190

188191
- <details>

discord_ui/slash/types.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,10 @@ def name(self, value):
439439
raise WrongType("name", value, "str")
440440
if len(value) > 32 or len(value) < 1:
441441
raise InvalidLength("name", 1, 32)
442-
self._json["name"] = format_name(value)
442+
if self.command_type == CommandType.SLASH:
443+
self._json["name"] = format_name(value)
444+
else:
445+
self._json["name"] = value
443446
@property
444447
def description(self) -> str:
445448
"""The description of the command

0 commit comments

Comments
 (0)