Skip to content

Commit

Permalink
Revert lil logic change to to_slash_option
Browse files Browse the repository at this point in the history
  • Loading branch information
FasterSpeeding committed Jan 25, 2023
1 parent 4f398a0 commit fc198dd
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tanjun/annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -1245,14 +1245,15 @@ def _slash_default(self) -> typing.Any:
return slash.UNDEFINED_DEFAULT if self.default is parsing.UNDEFINED else self.default

def to_slash_option(self, command: slash.SlashCommand[typing.Any], /) -> None:
if self.str_converters and not self.option_type:
self.option_type = str
option_type = self.option_type
if not option_type and self.str_converters:
option_type = str

if self.option_type:
if option_type:
if not self.description:
raise ValueError(f"Missing description for argument {self.parameter.name!r}")

self.SLASH_OPTION_ADDER[self.option_type](self, command, self.description)
self.SLASH_OPTION_ADDER[option_type](self, command, self.description)

SLASH_OPTION_ADDER: dict[
typing.Any, collections.Callable[[Self, slash.SlashCommand[typing.Any], str], slash.SlashCommand[typing.Any]]
Expand Down

0 comments on commit fc198dd

Please sign in to comment.