Skip to content

Commit 341fcce

Browse files
committed
fix: Check If Enum Has Docstring Before Using It As Option Description
1 parent 5a03f9d commit 341fcce

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

discord/commands/options.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ def __init__(
198198
enum_choices = []
199199
input_type_is_class = isinstance(input_type, type)
200200
if input_type_is_class and issubclass(input_type, (Enum, DiscordEnum)):
201-
if description is None:
201+
if description is None and input_type.__doc__ is not None:
202202
description = inspect.cleandoc(input_type.__doc__)
203203
if description and len(description) > 100:
204204
description = description[:97] + "..."

0 commit comments

Comments
 (0)