diff options
| author | 2020-04-01 09:40:30 +0200 | |
|---|---|---|
| committer | 2020-04-01 09:53:05 +0200 | |
| commit | a74debb82dba47ac843ac6b769d8d6d50f3e2f30 (patch) | |
| tree | 892e5d32a19e572ced60924b672a04025e91b982 /bot/exts | |
| parent | Deseasonify: yield ints representing days since cycle (diff) | |
Deseasonify: implement __str__ for Month enum
This way, we can standardize the way Months are shown to both the user
and the developer. Note that if passing a Month member to an f-string,
the `!s` format code must be specified to ensure our __str__ is used.
Co-authored-by: MarkKoz <[email protected]>
Diffstat (limited to 'bot/exts')
| -rw-r--r-- | bot/exts/evergreen/branding.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/bot/exts/evergreen/branding.py b/bot/exts/evergreen/branding.py index 140613e9..96acd587 100644 --- a/bot/exts/evergreen/branding.py +++ b/bot/exts/evergreen/branding.py @@ -15,6 +15,7 @@ from discord.ext import commands from bot.bot import SeasonalBot from bot.constants import Branding, Colours, Emojis, MODERATION_ROLES, Tokens from bot.seasons import SeasonBase, get_all_seasons, get_current_season, get_season +from bot.utils import human_months from bot.utils.decorators import with_role from bot.utils.exceptions import BrandingError from bot.utils.persist import make_persistent @@ -219,8 +220,7 @@ class BrandingManager(commands.Cog): # If we're in a non-evergreen season, also show active months if self.current_season is not SeasonBase: - active_months = ", ".join(m.name.title() for m in self.current_season.months) - title = f"{self.current_season.season_name} ({active_months})" + title = f"{self.current_season.season_name} ({human_months(self.current_season.months)})" else: title = self.current_season.season_name @@ -406,8 +406,7 @@ class BrandingManager(commands.Cog): if season is SeasonBase: active_when = "always" else: - months = ", ".join(m.name.title() for m in season.months) - active_when = f"in {months}" + active_when = f"in {human_months(season.months)}" description = ( f"Active {active_when}\n" |