Skip to content

Commit

Permalink
Test autocomplete
Browse files Browse the repository at this point in the history
  • Loading branch information
Saverio976 committed Sep 18, 2024
1 parent 5cc0e2f commit 2c55752
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion worldtimezone/extensions/world_clock.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@plugin.command
@lightbulb.add_cooldown(5, 1, lightbulb.UserBucket)
@lightbulb.option(
"timezone", "Your TimeZone", type=str, required=False, choices=world_clock_data.COMMON_TIMEZONES
"timezone", "Your TimeZone", type=str, required=False, autocomplete=True
)
@lightbulb.command("set", description="Set your TimeZone", pass_options=True)
@lightbulb.implements(lightbulb.SlashCommand)
Expand All @@ -28,6 +28,11 @@ async def setIt(ctx: lightbulb.SlashContext, timezone: Optional[str] = None) ->
await ctx.respond("Your TimeZone as been set!")


@setIt.autocomplete("timezone")
async def setIt_autocomplete_timezone(opt, inter):
return world_clock_data.COMMON_TIMEZONES


@lightbulb.add_checks(lightbulb.human_only)
@plugin.command
@lightbulb.add_cooldown(5, 1, lightbulb.UserBucket)
Expand Down

0 comments on commit 2c55752

Please sign in to comment.