Introduced i18n to CogStage
This commit is contained in:
@@ -115,8 +115,7 @@ class CogStage(Cog):
|
||||
media=[] if media is None else processed_media,
|
||||
)
|
||||
|
||||
# TODO Make a nice message
|
||||
await ctx.respond("Event stage has been created.")
|
||||
await ctx.respond(self.bot._("stage_created", "messages", locale=ctx.locale))
|
||||
|
||||
@command_group.command(
|
||||
name="edit",
|
||||
@@ -216,13 +215,11 @@ class CogStage(Cog):
|
||||
try:
|
||||
event_stage: PycordEventStage = await self.bot.find_event_stage(stage)
|
||||
except (InvalidId, EventStageNotFoundError):
|
||||
# TODO Make a nice message
|
||||
await ctx.respond("Event stage was not found.")
|
||||
await ctx.respond(self.bot._("stage_not_found", "messages", locale=ctx.locale))
|
||||
return
|
||||
|
||||
if order is not None and order > len(pycord_event.stage_ids):
|
||||
# TODO Make a nice message
|
||||
await ctx.respond("Stage sequence out of range.")
|
||||
await ctx.respond(self.bot._("stage_sequence_out_of_range", "messages", locale=ctx.locale))
|
||||
return
|
||||
|
||||
processed_media: List[Dict[str, Any]] = (
|
||||
@@ -239,7 +236,7 @@ class CogStage(Cog):
|
||||
if order is not None and order - 1 != event_stage.sequence:
|
||||
await pycord_event.reorder_stage(self.bot, event_stage._id, order - 1, cache=self.bot.cache)
|
||||
|
||||
await ctx.respond("Event stage has been updated.")
|
||||
await ctx.respond(self.bot._("stage_updated", "messages", locale=ctx.locale))
|
||||
|
||||
@command_group.command(
|
||||
name="delete",
|
||||
@@ -300,15 +297,13 @@ class CogStage(Cog):
|
||||
try:
|
||||
event_stage: PycordEventStage = await self.bot.find_event_stage(stage)
|
||||
except (InvalidId, EventStageNotFoundError):
|
||||
# TODO Make a nice message
|
||||
await ctx.respond("Event stage was not found.")
|
||||
await ctx.respond(self.bot._("stage_not_found", "messages", locale=ctx.locale))
|
||||
return
|
||||
|
||||
await pycord_event.remove_stage(self.bot, event_stage._id, cache=self.bot.cache)
|
||||
await event_stage.purge(cache=self.bot.cache)
|
||||
|
||||
# TODO Make a nice message
|
||||
await ctx.respond("Event stage has been deleted.")
|
||||
await ctx.respond(self.bot._("stage_deleted", "messages", locale=ctx.locale))
|
||||
|
||||
|
||||
def setup(bot: PycordBot) -> None:
|
||||
|
Reference in New Issue
Block a user