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

OptionChoice Bug Fix #679

Merged
merged 2 commits into from
Jan 7, 2022
Merged
Changes from 1 commit
Commits
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
3 changes: 2 additions & 1 deletion discord/commands/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ def __repr__(self):
class OptionChoice:
def __init__(self, name: str, value: Optional[Union[str, int, float]] = None):
self.name = name
self.value = value or name
self.value = value if value is not None else name
Lulalaby marked this conversation as resolved.
Show resolved Hide resolved

def to_dict(self) -> Dict[str, Union[str, int, float]]:
return {"name": self.name, "value": self.value}
Expand Down Expand Up @@ -857,6 +857,7 @@ def __init__(
)
self.name = name
self.description = description
self.input_type = SlashCommandOptionType.sub_command_group
plun1331 marked this conversation as resolved.
Show resolved Hide resolved
self.subcommands: List[Union[SlashCommand, SlashCommandGroup]] = self.__initial_commands__
self.guild_ids = guild_ids
self.parent = parent
Expand Down