diff options
-rw-r--r-- | bot/bot.py | 2 | ||||
-rw-r--r-- | bot/exts/easter/egg_facts.py | 7 | ||||
-rw-r--r-- | bot/exts/evergreen/branding.py | 2 | ||||
-rw-r--r-- | bot/exts/halloween/spookysound.py | 7 | ||||
-rw-r--r-- | bot/exts/pride/pride_facts.py | 7 |
5 files changed, 14 insertions, 11 deletions
@@ -151,7 +151,7 @@ class SeasonalBot(commands.Bot): async def send_log(self, title: str, details: str = None, *, icon: str = None) -> None: """Send an embed message to the devlog channel.""" - await self.wait_until_ready() + await self.wait_until_guild_available() devlog = self.get_channel(Channels.devlog) if not devlog: diff --git a/bot/exts/easter/egg_facts.py b/bot/exts/easter/egg_facts.py index 83918fb0..0051aa50 100644 --- a/bot/exts/easter/egg_facts.py +++ b/bot/exts/easter/egg_facts.py @@ -6,6 +6,7 @@ from pathlib import Path import discord from discord.ext import commands +from bot.bot import SeasonalBot from bot.constants import Channels, Colours, Month from bot.utils.decorators import seasonal_task @@ -19,7 +20,7 @@ class EasterFacts(commands.Cog): It also contains a background task which sends an easter egg fact in the event channel everyday. """ - def __init__(self, bot: commands.Bot): + def __init__(self, bot: SeasonalBot): self.bot = bot self.facts = self.load_json() @@ -35,7 +36,7 @@ class EasterFacts(commands.Cog): @seasonal_task(Month.APRIL) async def send_egg_fact_daily(self) -> None: """A background task that sends an easter egg fact in the event channel everyday.""" - await self.bot.wait_until_ready() + await self.bot.wait_until_guild_available() channel = self.bot.get_channel(Channels.seasonalbot_commands) await channel.send(embed=self.make_embed()) @@ -55,6 +56,6 @@ class EasterFacts(commands.Cog): ) -def setup(bot: commands.Bot) -> None: +def setup(bot: SeasonalBot) -> None: """Easter Egg facts cog load.""" bot.add_cog(EasterFacts(bot)) diff --git a/bot/exts/evergreen/branding.py b/bot/exts/evergreen/branding.py index 72f31042..1d463c5b 100644 --- a/bot/exts/evergreen/branding.py +++ b/bot/exts/evergreen/branding.py @@ -198,7 +198,7 @@ class BrandingManager(commands.Cog): All method calls in the internal loop are considered safe, i.e. no errors propagate to the daemon's loop. The daemon itself does not perform any error handling on its own. """ - await self.bot.wait_until_ready() + await self.bot.wait_until_guild_available() while True: self.current_season = get_current_season() diff --git a/bot/exts/halloween/spookysound.py b/bot/exts/halloween/spookysound.py index 325447e5..569a9153 100644 --- a/bot/exts/halloween/spookysound.py +++ b/bot/exts/halloween/spookysound.py @@ -5,6 +5,7 @@ from pathlib import Path import discord from discord.ext import commands +from bot.bot import SeasonalBot from bot.constants import Hacktoberfest log = logging.getLogger(__name__) @@ -13,7 +14,7 @@ log = logging.getLogger(__name__) class SpookySound(commands.Cog): """A cog that plays a spooky sound in a voice channel on command.""" - def __init__(self, bot: commands.Bot): + def __init__(self, bot: SeasonalBot): self.bot = bot self.sound_files = list(Path("bot/resources/halloween/spookysounds").glob("*.mp3")) self.channel = None @@ -27,7 +28,7 @@ class SpookySound(commands.Cog): Cannot be used more than once in 2 minutes. """ if not self.channel: - await self.bot.wait_until_ready() + await self.bot.wait_until_guild_available() self.channel = self.bot.get_channel(Hacktoberfest.voice_id) await ctx.send("Initiating spooky sound...") @@ -42,6 +43,6 @@ class SpookySound(commands.Cog): await voice.disconnect() -def setup(bot: commands.Bot) -> None: +def setup(bot: SeasonalBot) -> None: """Spooky sound Cog load.""" bot.add_cog(SpookySound(bot)) diff --git a/bot/exts/pride/pride_facts.py b/bot/exts/pride/pride_facts.py index f759dcb1..c453bfa1 100644 --- a/bot/exts/pride/pride_facts.py +++ b/bot/exts/pride/pride_facts.py @@ -9,6 +9,7 @@ import dateutil.parser import discord from discord.ext import commands +from bot.bot import SeasonalBot from bot.constants import Channels, Colours, Month from bot.utils.decorators import seasonal_task @@ -20,7 +21,7 @@ Sendable = Union[commands.Context, discord.TextChannel] class PrideFacts(commands.Cog): """Provides a new fact every day during the Pride season!""" - def __init__(self, bot: commands.Bot): + def __init__(self, bot: SeasonalBot): self.bot = bot self.facts = self.load_facts() @@ -35,7 +36,7 @@ class PrideFacts(commands.Cog): @seasonal_task(Month.JUNE) async def send_pride_fact_daily(self) -> None: """Background task to post the daily pride fact every day.""" - await self.bot.wait_until_ready() + await self.bot.wait_until_guild_available() channel = self.bot.get_channel(Channels.seasonalbot_commands) await self.send_select_fact(channel, datetime.utcnow()) @@ -101,6 +102,6 @@ class PrideFacts(commands.Cog): ) -def setup(bot: commands.Bot) -> None: +def setup(bot: SeasonalBot) -> None: """Cog loader for pride facts.""" bot.add_cog(PrideFacts(bot)) |