aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar kwzrd <[email protected]>2020-03-22 17:39:38 +0100
committerGravatar kwzrd <[email protected]>2020-03-22 17:41:54 +0100
commite04e03b775d9902cc0fd1fa2e3da9e52d1c33648 (patch)
tree8dc191806496b530a0d289f6e5484ea7bfafe988
parentDeseasonify: guard bot nickname setter (diff)
Deseasonify: propagate success value of `set_icon`
The `set_icon` will return False if the application fails. Sine the `cycle` function wraps it, it should allow for the value to propagate out.
-rw-r--r--bot/branding.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/bot/branding.py b/bot/branding.py
index 195d46a2..e6ab44b5 100644
--- a/bot/branding.py
+++ b/bot/branding.py
@@ -262,7 +262,11 @@ class BrandingManager(commands.Cog):
return branding_changed
async def cycle(self) -> bool:
- """Apply the next-up server icon."""
+ """
+ Apply the next-up server icon.
+
+ Returns True if an icon is available and successfully gets applied, False otherwise.
+ """
if not self.available_icons:
log.info("Cannot cycle: no icons for this season")
return False
@@ -272,10 +276,11 @@ class BrandingManager(commands.Cog):
log.info(f"Set remaining icons: {await pretty_files(self.remaining_icons)}")
next_up, *self.remaining_icons = self.remaining_icons
- # await self.bot.set_icon(next_up.download_url)
+ # success = await self.bot.set_icon(next_up.download_url)
log.info(f"Applying icon: {next_up}")
+ success = True # Default value during development
- return True
+ return success
async def apply(self) -> None:
"""