Skip to content

Commit

Permalink
fix command option ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
snazzyfox committed Aug 18, 2023
1 parent dce7d7a commit 6f0bfc6
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 28 deletions.
6 changes: 3 additions & 3 deletions dingomata/discord_bot/commands/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ async def profile_remove_group(ctx: lightbulb.SlashContext) -> None:


@profile_add_group.child
@lightbulb.option("month", description="Month of the birthday", type=int, choices=_MONTHS)
@lightbulb.option("day", description="Day of the birthday", type=int, min_value=1, max_value=31)
@lightbulb.option("month", description="Month of the birthday", type=int, choices=_MONTHS)
@lightbulb.command(name="birthday", description="Set your birthday.", ephemeral=True)
@lightbulb.implements(lightbulb.SlashSubCommand)
async def profile_add_birthday(ctx: lightbulb.SlashContext) -> None:
Expand Down Expand Up @@ -112,8 +112,8 @@ async def next_birthdays(ctx: lightbulb.SlashContext) -> None:


@profile_add_group.child
@lightbulb.option('service', description="Service or game this friend code is for", choices=_FRIEND_CODE_SERVICES)
@lightbulb.option('code', description='Friend code you would like to add')
@lightbulb.option('service', description="Service or game this friend code is for", choices=_FRIEND_CODE_SERVICES)
@lightbulb.command(name="friend_code", description="Add your friend code.", ephemeral=True)
@lightbulb.implements(lightbulb.SlashSubCommand)
async def profile_add_friend_code(ctx: lightbulb.SlashContext) -> None:
Expand All @@ -132,9 +132,9 @@ async def profile_remove_friend_code(ctx: lightbulb.SlashContext) -> None:


@profile_add_group.child
@lightbulb.option("url", description="An image URL posted on Discord of the ref sheet")
@lightbulb.option("name", description="Name for the ref sheet. If this name already exists, "
"it will replace the existing one.")
@lightbulb.option("url", description="An image URL posted on Discord of the ref sheet")
@lightbulb.command(name="refsheet", description="Add a new ref sheet", ephemeral=True)
@lightbulb.implements(lightbulb.SlashSubCommand)
async def profile_add_refsheet(ctx: lightbulb.SlashContext) -> None:
Expand Down
2 changes: 1 addition & 1 deletion dingomata/discord_bot/commands/quote.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ async def quotes_group(ctx: lightbulb.ApplicationContext) -> None:


@quotes_group.child
@lightbulb.option("user", description="Who said it?", type=hikari.Member)
@lightbulb.option("content", description="What did they say?")
@lightbulb.option("user", description="Who said it?", type=hikari.Member)
@lightbulb.command("add", description="Add a new quote", ephemeral=True)
@lightbulb.implements(lightbulb.SlashSubCommand)
async def quotes_add(ctx: lightbulb.SlashContext) -> None:
Expand Down
2 changes: 1 addition & 1 deletion dingomata/discord_bot/commands/reminder.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ async def reminder_group(ctx: lightbulb.SlashContext) -> None:

@reminder_group.child
@lightbulb.add_checks(lightbulb.bot_has_guild_permissions(hikari.Permissions.SEND_MESSAGES))
@lightbulb.option("time", description="How much later you want the reminder. For example, 10 minutes or 2 days.")
@lightbulb.option("about", description="What I should remind you about.")
@lightbulb.option("time", description="How much later you want the reminder. For example, 10 minutes or 2 days.")
@lightbulb.command(
"set",
description="Set a new reminder. I'll send you a reminder in this channel around the time you ask for.",
Expand Down
8 changes: 4 additions & 4 deletions dingomata/discord_bot/commands/roles.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,11 @@ async def roles_dropdown_create(ctx: lightbulb.SlashContext) -> None:


@roles_dropdown_group.child
@lightbulb.option('dropdown_url', description='URL to an existing message with dropdown')
@lightbulb.option('role', description='The first role to add as an option', type=hikari.Role)
@lightbulb.option('emoji', description='Optional emoji to show next to the role', type=str, default=None)
@lightbulb.option('description', description='Optional description of the role to add as an option', type=str,
default=None)
@lightbulb.option('emoji', description='Optional emoji to show next to the role', type=str, default=None)
@lightbulb.option('dropdown_url', description='URL to an existing message with dropdown')
@lightbulb.option('role', description='The role to add as an option', type=hikari.Role)
@lightbulb.command('add', description="Add a role to an existing role dropdown.", ephemeral=True)
@lightbulb.implements(lightbulb.SlashSubCommand)
async def roles_dropdown_add(ctx: lightbulb.SlashContext) -> None:
Expand Down Expand Up @@ -142,7 +142,7 @@ async def roles_dropdown_add(ctx: lightbulb.SlashContext) -> None:

@roles_dropdown_group.child
@lightbulb.option('dropdown_url', description='URL to an existing message with dropdown')
@lightbulb.option('role', description='The first role to add as an option', type=hikari.Role)
@lightbulb.option('role', description='The role to remove as an option', type=hikari.Role)
@lightbulb.command('remove', description="Add a role to an existing role dropdown.", ephemeral=True)
@lightbulb.implements(lightbulb.SlashSubCommand)
async def roles_dropdown_remove(ctx: lightbulb.SlashContext) -> None:
Expand Down
2 changes: 1 addition & 1 deletion dingomata/discord_bot/commands/timezone.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ async def timezone_get(ctx: lightbulb.SlashContext):


@plugin.command
@lightbulb.option('time', description="A date and/or time, e.g. 2020/01/01 00:00:00")
@lightbulb.option('timezone', description="Time this time is in. If not provided, uses your personal timezone.",
autocomplete=True, default=None)
@lightbulb.option('time', description="A date and/or time, e.g. 2020/01/01 00:00:00")
@lightbulb.command("localtime", description="Convert time between timezones.", ephemeral=True)
async def localtime(ctx: lightbulb.SlashContext) -> None:
if ctx.options.timezone:
Expand Down
79 changes: 61 additions & 18 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ async-lru = "^2.0.4"
hikari-lightbulb = "^2.3.3"
hikari = { extras = ["speedups"], version = "*" } # This will be constrained by lightbulb
cachetools = "^5.3.1"
# TwitchIO for twitch bot - waiting on twitchio 3.0 which will not be incompatible with hikari

[tool.poetry.group.dev.dependencies]
pre-commit = "^3.3.3"
Expand Down

0 comments on commit 6f0bfc6

Please sign in to comment.