Skip to content

Commit

Permalink
Remove warning
Browse files Browse the repository at this point in the history
  • Loading branch information
tandemdude committed Apr 17, 2023
1 parent 3bc57e7 commit 6998736
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions lightbulb/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -1262,20 +1262,11 @@ def flatten_command_option(
await event.interaction.create_response([])
return

warned = False

def convert_response_value(
val: t.Union[str, int, float, hikari.api.AutocompleteChoiceBuilder]
) -> hikari.api.AutocompleteChoiceBuilder:
if isinstance(val, (str, int, float)):
return hikari.impl.AutocompleteChoiceBuilder(name=str(val), value=val)
if isinstance(val, hikari.CommandChoice):
nonlocal warned
if not warned:
_LOGGER.warning(
"DeprecationWarning: Passing CommandChoice is deprecated and will be removed in `2.0.0.dev119`. Use AutocompleteChoiceBuilder instead"
)
warned = True

return hikari.impl.AutocompleteChoiceBuilder(name=val.name, value=val.value)

Expand Down

0 comments on commit 6998736

Please sign in to comment.