aboutsummaryrefslogtreecommitdiffstats
path: root/bot
diff options
context:
space:
mode:
authorGravatar Chris Lovering <[email protected]>2022-09-23 22:12:26 +0100
committerGravatar Chris Lovering <[email protected]>2022-09-23 22:12:26 +0100
commit952a3a7849d4694cc3e4aa89021d3c976cdc537b (patch)
tree4d9a9684d6c0d8f1f749355353fbadb7fd89960b /bot
parentUpdate games cog token refresh logic (diff)
Remove all wait_until_guil_available as this is now done in bot-core
Diffstat (limited to 'bot')
-rw-r--r--bot/bot.py1
-rw-r--r--bot/exts/events/advent_of_code/_cog.py1
-rw-r--r--bot/exts/events/advent_of_code/_helpers.py10
-rw-r--r--bot/exts/holidays/easter/egg_facts.py2
-rw-r--r--bot/exts/holidays/halloween/spookynamerate.py1
-rw-r--r--bot/exts/holidays/pride/pride_facts.py2
-rw-r--r--bot/exts/utilities/logging.py2
-rw-r--r--bot/exts/utilities/reddit.py5
8 files changed, 1 insertions, 23 deletions
diff --git a/bot/bot.py b/bot/bot.py
index 9309f50c..636946f1 100644
--- a/bot/bot.py
+++ b/bot/bot.py
@@ -42,7 +42,6 @@ class Bot(BotBase):
async def log_to_dev_log(self, title: str, details: str = None, *, icon: str = None) -> None:
"""Send an embed message to the dev-log channel."""
- await self.wait_until_guild_available()
devlog = self.get_channel(constants.Channels.devlog)
if not icon:
diff --git a/bot/exts/events/advent_of_code/_cog.py b/bot/exts/events/advent_of_code/_cog.py
index ab5a7a34..49140a3f 100644
--- a/bot/exts/events/advent_of_code/_cog.py
+++ b/bot/exts/events/advent_of_code/_cog.py
@@ -70,7 +70,6 @@ class AdventOfCode(commands.Cog):
Runs on a schedule, as defined in the task.loop decorator.
"""
- await self.bot.wait_until_guild_available()
guild = self.bot.get_guild(Client.guild)
completionist_role = guild.get_role(Roles.aoc_completionist)
if completionist_role is None:
diff --git a/bot/exts/events/advent_of_code/_helpers.py b/bot/exts/events/advent_of_code/_helpers.py
index 6c004901..abd80b77 100644
--- a/bot/exts/events/advent_of_code/_helpers.py
+++ b/bot/exts/events/advent_of_code/_helpers.py
@@ -523,13 +523,6 @@ async def countdown_status(bot: Bot) -> None:
# Log that we're going to start with the countdown status.
log.info("The Advent of Code has started or will start soon, starting countdown status.")
- # Trying to change status too early in the bot's startup sequence will fail
- # the task because the websocket instance has not yet been created. Waiting
- # for this event means that both the websocket instance has been initialized
- # and that the connection to Discord is mature enough to change the presence
- # of the bot.
- await bot.wait_until_guild_available()
-
# Calculate when the task needs to stop running. To prevent the task from
# sleeping for the entire year, it will only wait in the currently
# configured year. This means that the task will only start hibernating once
@@ -578,9 +571,6 @@ async def new_puzzle_notification(bot: Bot) -> None:
log.info("The Advent of Code has started or will start soon, waking up notification task.")
- # Ensure that the guild cache is loaded so we can get the Advent of Code
- # channel and role.
- await bot.wait_until_guild_available()
aoc_channel = bot.get_channel(Channels.advent_of_code)
aoc_role = aoc_channel.guild.get_role(AdventOfCode.role_id)
diff --git a/bot/exts/holidays/easter/egg_facts.py b/bot/exts/holidays/easter/egg_facts.py
index 2fb2041e..43b31c7b 100644
--- a/bot/exts/holidays/easter/egg_facts.py
+++ b/bot/exts/holidays/easter/egg_facts.py
@@ -29,8 +29,6 @@ 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_guild_available()
-
channel = self.bot.get_channel(Channels.sir_lancebot_playground)
await channel.send(embed=self.make_embed())
diff --git a/bot/exts/holidays/halloween/spookynamerate.py b/bot/exts/holidays/halloween/spookynamerate.py
index 5d41ce6d..a76e5e12 100644
--- a/bot/exts/holidays/halloween/spookynamerate.py
+++ b/bot/exts/holidays/halloween/spookynamerate.py
@@ -355,7 +355,6 @@ class SpookyNameRate(Cog):
async def get_channel(self) -> Optional[TextChannel]:
"""Gets the sir-lancebot-channel after waiting until ready."""
- await self.bot.wait_until_ready()
channel = self.bot.get_channel(
Channels.sir_lancebot_playground
) or await self.bot.fetch_channel(Channels.sir_lancebot_playground)
diff --git a/bot/exts/holidays/pride/pride_facts.py b/bot/exts/holidays/pride/pride_facts.py
index ae025ae7..36a9415e 100644
--- a/bot/exts/holidays/pride/pride_facts.py
+++ b/bot/exts/holidays/pride/pride_facts.py
@@ -28,8 +28,6 @@ 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_guild_available()
-
channel = self.bot.get_channel(Channels.sir_lancebot_playground)
await self.send_select_fact(channel, datetime.utcnow())
diff --git a/bot/exts/utilities/logging.py b/bot/exts/utilities/logging.py
index e1d09fdf..83b7025f 100644
--- a/bot/exts/utilities/logging.py
+++ b/bot/exts/utilities/logging.py
@@ -23,8 +23,6 @@ class Logging(Cog):
async def check_channels(self) -> None:
"""Verifies that all channel constants refer to channels which exist."""
- await self.bot.wait_until_guild_available()
-
if constants.Client.debug:
log.info("Skipping Channels Check.")
return
diff --git a/bot/exts/utilities/reddit.py b/bot/exts/utilities/reddit.py
index 07222d79..028c16bc 100644
--- a/bot/exts/utilities/reddit.py
+++ b/bot/exts/utilities/reddit.py
@@ -48,9 +48,7 @@ class Reddit(Cog):
async def cog_load(self) -> None:
"""Sets the reddit webhook when the cog is loaded."""
- await self.bot.wait_until_guild_available()
- if not self.webhook:
- self.webhook = await self.bot.fetch_webhook(RedditConfig.webhook)
+ self.webhook = await self.bot.fetch_webhook(RedditConfig.webhook)
@property
def channel(self) -> TextChannel:
@@ -256,7 +254,6 @@ class Reddit(Cog):
await sleep_until(midnight_tomorrow)
- await self.bot.wait_until_guild_available()
if not self.webhook:
await self.bot.fetch_webhook(RedditConfig.webhook)