aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar kwzrd <[email protected]>2020-03-22 16:18:59 +0100
committerGravatar kwzrd <[email protected]>2020-03-22 16:18:59 +0100
commitd137d6b81ebe8e0d58bdf24ccb6187a0f7f6e03d (patch)
tree2bed9f0bfc5990f9311cd7b87e8b86ed7d9bee80
parentDeseasonify: add daemon command group (diff)
Deseasonify: do not automatically `apply` after `set`
The previous design was such that calling `set` with a new season will automatically apply the branding. This meant 'previewing' a season would require a separate command. Since `apply` is an expensive operation with consequences, it appears logical to require that the user invokes it separately & explicitly. See docstring for further details.
-rw-r--r--bot/branding.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/bot/branding.py b/bot/branding.py
index 4204bcd6..683dce61 100644
--- a/bot/branding.py
+++ b/bot/branding.py
@@ -332,7 +332,20 @@ class BrandingManager(commands.Cog):
@branding_cmds.command(name="set")
async def branding_set(self, ctx: commands.Context, *, season_name: t.Optional[str] = None) -> None:
- """Manually set season if `season_name` is provided, otherwise reset to current."""
+ """
+ Manually set season if `season_name` is provided, otherwise reset to current.
+
+ This only pre-loads the cog's internal state to the chosen season, but does not
+ automatically apply the branding. As that is an expensive operation, the `apply`
+ command must be called explicitly after this command finishes.
+
+ This means that this command can be used to 'preview' a season gathering info
+ about its available assets, without applying them to the guild.
+
+ If the daemon is running, it will automatically reset the season to current when
+ it wakes up. The season set via this command can therefore remain 'detached' from
+ what it should be - the daemon will make sure that it's set back properly.
+ """
if season_name is None:
new_season = get_current_season()
else:
@@ -344,7 +357,6 @@ class BrandingManager(commands.Cog):
async with ctx.typing():
self.current_season = new_season
await self.refresh()
- await self.apply()
await self.branding_info(ctx)
else:
await ctx.send(f"Season {self.current_season.season_name} already active")