Improved (still partial) i18n for /stage and /user
This commit is contained in:
@@ -28,21 +28,45 @@ class CogStage(Cog):
|
||||
description_localizations=in_every_locale("description", "commands", "stage"),
|
||||
)
|
||||
|
||||
# TODO Introduce i18n
|
||||
# TODO Maybe add an option for order?
|
||||
@command_group.command(
|
||||
name="add",
|
||||
description="Add new event stage",
|
||||
description=_("description", "commands", "stage_add"),
|
||||
description_localizations=in_every_locale("description", "commands", "stage_add"),
|
||||
)
|
||||
@option(
|
||||
"event",
|
||||
description="Name of the event",
|
||||
description=_("description", "commands", "stage_add", "options", "event"),
|
||||
description_localizations=in_every_locale(
|
||||
"description", "commands", "stage_add", "options", "event"
|
||||
),
|
||||
autocomplete=basic_autocomplete(autocomplete_active_events),
|
||||
required=True,
|
||||
)
|
||||
@option("question", description="Question to be answered", required=True)
|
||||
@option("answer", description="Answer to the stage's question", required=True)
|
||||
@option("media", description="Media file to be attached", required=False)
|
||||
@option(
|
||||
"question",
|
||||
description=_("description", "commands", "stage_add", "options", "question"),
|
||||
description_localizations=in_every_locale(
|
||||
"description", "commands", "stage_add", "options", "question"
|
||||
),
|
||||
required=True,
|
||||
)
|
||||
@option(
|
||||
"answer",
|
||||
description=_("description", "commands", "stage_add", "options", "answer"),
|
||||
description_localizations=in_every_locale(
|
||||
"description", "commands", "stage_add", "options", "answer"
|
||||
),
|
||||
required=True,
|
||||
)
|
||||
@option(
|
||||
"media",
|
||||
description=_("description", "commands", "stage_add", "options", "media"),
|
||||
description_localizations=in_every_locale(
|
||||
"description", "commands", "stage_add", "options", "media"
|
||||
),
|
||||
required=False,
|
||||
)
|
||||
async def command_stage_add(
|
||||
self,
|
||||
ctx: ApplicationContext,
|
||||
@@ -85,30 +109,70 @@ class CogStage(Cog):
|
||||
# TODO Make a nice message
|
||||
await ctx.respond("Event stage has been created.")
|
||||
|
||||
# TODO Implement the command
|
||||
# /stage edit <event> <stage> <order> <question> <answer> <media>
|
||||
@command_group.command(
|
||||
name="edit",
|
||||
description="Edit the event stage",
|
||||
description=_("description", "commands", "stage_edit"),
|
||||
description_localizations=in_every_locale("description", "commands", "stage_edit"),
|
||||
)
|
||||
@option(
|
||||
"event",
|
||||
description="Name of the event",
|
||||
description=_("description", "commands", "stage_edit", "options", "event"),
|
||||
description_localizations=in_every_locale(
|
||||
"description", "commands", "stage_edit", "options", "event"
|
||||
),
|
||||
autocomplete=basic_autocomplete(autocomplete_active_events),
|
||||
required=True,
|
||||
)
|
||||
# TODO Add autofill
|
||||
@option(
|
||||
"stage",
|
||||
description="Stage to edit",
|
||||
description=_("description", "commands", "stage_edit", "options", "stage"),
|
||||
description_localizations=in_every_locale(
|
||||
"description", "commands", "stage_edit", "options", "stage"
|
||||
),
|
||||
autocomplete=basic_autocomplete(autocomplete_event_stages),
|
||||
required=True,
|
||||
)
|
||||
@option("order", description="Number in the event stages' order", min_value=1, required=False)
|
||||
@option("question", description="Question to be answered", required=False)
|
||||
@option("answer", description="Answer to the stage's question", required=False)
|
||||
@option("media", description="Media file to be attached", required=False)
|
||||
@option("remove_media", description="Remove attached media", required=False)
|
||||
@option(
|
||||
"order",
|
||||
description=_("description", "commands", "stage_edit", "options", "order"),
|
||||
description_localizations=in_every_locale(
|
||||
"description", "commands", "stage_edit", "options", "order"
|
||||
),
|
||||
min_value=1,
|
||||
required=False,
|
||||
)
|
||||
@option(
|
||||
"question",
|
||||
description=_("description", "commands", "stage_edit", "options", "question"),
|
||||
description_localizations=in_every_locale(
|
||||
"description", "commands", "stage_edit", "options", "question"
|
||||
),
|
||||
required=False,
|
||||
)
|
||||
@option(
|
||||
"answer",
|
||||
description=_("description", "commands", "stage_edit", "options", "answer"),
|
||||
description_localizations=in_every_locale(
|
||||
"description", "commands", "stage_edit", "options", "answer"
|
||||
),
|
||||
required=False,
|
||||
)
|
||||
@option(
|
||||
"media",
|
||||
description=_("description", "commands", "stage_edit", "options", "media"),
|
||||
description_localizations=in_every_locale(
|
||||
"description", "commands", "stage_edit", "options", "media"
|
||||
),
|
||||
required=False,
|
||||
)
|
||||
@option(
|
||||
"remove_media",
|
||||
description=_("description", "commands", "stage_edit", "options", "remove_media"),
|
||||
description_localizations=in_every_locale(
|
||||
"description", "commands", "stage_edit", "options", "remove_media"
|
||||
),
|
||||
required=False,
|
||||
)
|
||||
async def command_stage_edit(
|
||||
self,
|
||||
ctx: ApplicationContext,
|
||||
@@ -164,25 +228,37 @@ class CogStage(Cog):
|
||||
|
||||
await ctx.respond("Event stage has been updated.")
|
||||
|
||||
# TODO Implement the command
|
||||
# /stage delete <event> <stage> <confirm>
|
||||
@command_group.command(
|
||||
name="delete",
|
||||
description="Delete the event stage",
|
||||
description=_("description", "commands", "stage_delete"),
|
||||
description_localizations=in_every_locale("description", "commands", "stage_delete"),
|
||||
)
|
||||
@option(
|
||||
"event",
|
||||
description="Name of the event",
|
||||
description=_("description", "commands", "stage_delete", "options", "event"),
|
||||
description_localizations=in_every_locale(
|
||||
"description", "commands", "stage_delete", "options", "event"
|
||||
),
|
||||
autocomplete=basic_autocomplete(autocomplete_active_events),
|
||||
required=True,
|
||||
)
|
||||
@option(
|
||||
"stage",
|
||||
description="Stage to delete",
|
||||
description=_("description", "commands", "stage_delete", "options", "stage"),
|
||||
description_localizations=in_every_locale(
|
||||
"description", "commands", "stage_delete", "options", "stage"
|
||||
),
|
||||
autocomplete=basic_autocomplete(autocomplete_event_stages),
|
||||
required=True,
|
||||
)
|
||||
@option("confirm", description="Confirmation of the operation", required=False)
|
||||
@option(
|
||||
"confirm",
|
||||
description=_("description", "commands", "stage_delete", "options", "confirm"),
|
||||
description_localizations=in_every_locale(
|
||||
"description", "commands", "stage_delete", "options", "confirm"
|
||||
),
|
||||
required=False,
|
||||
)
|
||||
async def command_stage_delete(
|
||||
self, ctx: ApplicationContext, event: str, stage: str, confirm: bool = False
|
||||
) -> None:
|
||||
|
Reference in New Issue
Block a user