diff options
author | 2019-11-28 22:32:42 +0100 | |
---|---|---|
committer | 2019-11-28 22:32:42 +0100 | |
commit | f15e977a53eaf3d3f544b25611d562ea7be201ec (patch) | |
tree | ca7235eec3779e5d1ac007715dae18a0d2e7cd46 /bot | |
parent | Merge pull request #313 from eivl/AoC/current-year-fix (diff) | |
parent | Merge branch 'master' into announcement-flag (diff) |
Merge pull request #315 from python-discord/announcement-flag
Default seasons to not send announcements
Diffstat (limited to 'bot')
-rw-r--r-- | bot/seasons/season.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/bot/seasons/season.py b/bot/seasons/season.py index 3546fda6..e7b7a69c 100644 --- a/bot/seasons/season.py +++ b/bot/seasons/season.py @@ -79,6 +79,7 @@ class SeasonBase: start_date: Optional[str] = None end_date: Optional[str] = None + should_announce: bool = False colour: Optional[int] = None icon: Tuple[str, ...] = ("/logos/logo_full/logo_full.png",) @@ -268,11 +269,11 @@ class SeasonBase: """ Announces a change in season in the announcement channel. - It will skip the announcement if the current active season is the "evergreen" default season. + Auto-announcement is configured by the `should_announce` `SeasonBase` attribute """ - # Don't actually announce if reverting to normal season - if self.name in ("evergreen", "wildcard", "halloween"): - log.debug(f"Season Changed: {self.name}") + # Short circuit if the season had disabled automatic announcements + if not self.should_announce: + log.debug(f"Season changed without announcement: {self.name}") return guild = bot.get_guild(Client.guild) |