aboutsummaryrefslogtreecommitdiffstats
path: root/bot/exts/fun
diff options
context:
space:
mode:
Diffstat (limited to 'bot/exts/fun')
-rw-r--r--bot/exts/fun/anagram.py4
-rw-r--r--bot/exts/fun/battleship.py4
-rw-r--r--bot/exts/fun/catify.py4
-rw-r--r--bot/exts/fun/coinflip.py4
-rw-r--r--bot/exts/fun/connect_four.py4
-rw-r--r--bot/exts/fun/duck_game.py4
-rw-r--r--bot/exts/fun/fun.py4
-rw-r--r--bot/exts/fun/game.py86
-rw-r--r--bot/exts/fun/hangman.py4
-rw-r--r--bot/exts/fun/latex.py4
-rw-r--r--bot/exts/fun/madlibs.py4
-rw-r--r--bot/exts/fun/magic_8ball.py4
-rw-r--r--bot/exts/fun/minesweeper.py10
-rw-r--r--bot/exts/fun/movie.py8
-rw-r--r--bot/exts/fun/quack.py4
-rw-r--r--bot/exts/fun/recommend_game.py4
-rw-r--r--bot/exts/fun/rps.py4
-rw-r--r--bot/exts/fun/snakes/__init__.py4
-rw-r--r--bot/exts/fun/snakes/_snakes_cog.py3
-rw-r--r--bot/exts/fun/space.py8
-rw-r--r--bot/exts/fun/speedrun.py4
-rw-r--r--bot/exts/fun/status_codes.py4
-rw-r--r--bot/exts/fun/tic_tac_toe.py4
-rw-r--r--bot/exts/fun/trivia_quiz.py6
-rw-r--r--bot/exts/fun/uwu.py4
-rw-r--r--bot/exts/fun/wonder_twins.py4
-rw-r--r--bot/exts/fun/xkcd.py4
27 files changed, 101 insertions, 104 deletions
diff --git a/bot/exts/fun/anagram.py b/bot/exts/fun/anagram.py
index 79280fa9..d8ea6a55 100644
--- a/bot/exts/fun/anagram.py
+++ b/bot/exts/fun/anagram.py
@@ -104,6 +104,6 @@ class Anagram(commands.Cog):
await game.message_creation(message)
-def setup(bot: Bot) -> None:
+async def setup(bot: Bot) -> None:
"""Load the Anagram cog."""
- bot.add_cog(Anagram(bot))
+ await bot.add_cog(Anagram(bot))
diff --git a/bot/exts/fun/battleship.py b/bot/exts/fun/battleship.py
index 77e38427..a8039cf2 100644
--- a/bot/exts/fun/battleship.py
+++ b/bot/exts/fun/battleship.py
@@ -442,6 +442,6 @@ class Battleship(commands.Cog):
await ctx.send(embed=embed)
-def setup(bot: Bot) -> None:
+async def setup(bot: Bot) -> None:
"""Load the Battleship Cog."""
- bot.add_cog(Battleship(bot))
+ await bot.add_cog(Battleship(bot))
diff --git a/bot/exts/fun/catify.py b/bot/exts/fun/catify.py
index 32dfae09..6e8c75ba 100644
--- a/bot/exts/fun/catify.py
+++ b/bot/exts/fun/catify.py
@@ -81,6 +81,6 @@ class Catify(commands.Cog):
)
-def setup(bot: Bot) -> None:
+async def setup(bot: Bot) -> None:
"""Loads the catify cog."""
- bot.add_cog(Catify())
+ await bot.add_cog(Catify())
diff --git a/bot/exts/fun/coinflip.py b/bot/exts/fun/coinflip.py
index 804306bd..b7dee44d 100644
--- a/bot/exts/fun/coinflip.py
+++ b/bot/exts/fun/coinflip.py
@@ -48,6 +48,6 @@ class CoinFlip(commands.Cog):
await ctx.send(message)
-def setup(bot: Bot) -> None:
+async def setup(bot: Bot) -> None:
"""Loads the coinflip cog."""
- bot.add_cog(CoinFlip())
+ await bot.add_cog(CoinFlip())
diff --git a/bot/exts/fun/connect_four.py b/bot/exts/fun/connect_four.py
index 1b88d065..0d870a6e 100644
--- a/bot/exts/fun/connect_four.py
+++ b/bot/exts/fun/connect_four.py
@@ -447,6 +447,6 @@ class ConnectFour(commands.Cog):
await self._play_game(ctx, None, board_size, str(emoji1), str(emoji2))
-def setup(bot: Bot) -> None:
+async def setup(bot: Bot) -> None:
"""Load ConnectFour Cog."""
- bot.add_cog(ConnectFour(bot))
+ await bot.add_cog(ConnectFour(bot))
diff --git a/bot/exts/fun/duck_game.py b/bot/exts/fun/duck_game.py
index 10b03a49..a2612e51 100644
--- a/bot/exts/fun/duck_game.py
+++ b/bot/exts/fun/duck_game.py
@@ -341,6 +341,6 @@ class DuckGamesDirector(commands.Cog):
return await ctx.send(file=file, embed=embed)
-def setup(bot: Bot) -> None:
+async def setup(bot: Bot) -> None:
"""Load the DuckGamesDirector cog."""
- bot.add_cog(DuckGamesDirector(bot))
+ await bot.add_cog(DuckGamesDirector(bot))
diff --git a/bot/exts/fun/fun.py b/bot/exts/fun/fun.py
index e7337cb6..779db977 100644
--- a/bot/exts/fun/fun.py
+++ b/bot/exts/fun/fun.py
@@ -157,6 +157,6 @@ class Fun(Cog):
await ctx.send(joke)
-def setup(bot: Bot) -> None:
+async def setup(bot: Bot) -> None:
"""Load the Fun cog."""
- bot.add_cog(Fun(bot))
+ await bot.add_cog(Fun(bot))
diff --git a/bot/exts/fun/game.py b/bot/exts/fun/game.py
index 5f56bef7..4e01444e 100644
--- a/bot/exts/fun/game.py
+++ b/bot/exts/fun/game.py
@@ -2,12 +2,12 @@ import difflib
import logging
import random
import re
-from asyncio import sleep
from datetime import datetime as dt, timedelta
from enum import IntEnum
from typing import Any, Optional
from aiohttp import ClientSession
+from botcore.utils import scheduling
from discord import Embed
from discord.ext import tasks
from discord.ext.commands import Cog, Context, group
@@ -15,7 +15,6 @@ from discord.ext.commands import Cog, Context, group
from bot.bot import Bot
from bot.constants import STAFF_ROLES, Tokens
from bot.utils.decorators import with_role
-from bot.utils.extensions import invoke_help_command
from bot.utils.pagination import ImagePaginator, LinePaginator
# Base URL of IGDB API
@@ -185,46 +184,45 @@ class Games(Cog):
self.genres: dict[str, int] = {}
self.headers = BASE_HEADERS
+ self.token_refresh_scheduler = scheduling.Scheduler(__name__)
- self.bot.loop.create_task(self.renew_access_token())
-
- async def renew_access_token(self) -> None:
- """Refeshes V4 access token a number of seconds before expiry. See `ACCESS_TOKEN_RENEWAL_WINDOW`."""
- while True:
- async with self.http_session.post(OAUTH_URL, params=OAUTH_PARAMS) as resp:
- result = await resp.json()
- if resp.status != 200:
- # If there is a valid access token continue to use that,
- # otherwise unload cog.
- if "Authorization" in self.headers:
- time_delta = timedelta(seconds=ACCESS_TOKEN_RENEWAL_WINDOW)
- logger.error(
- "Failed to renew IGDB access token. "
- f"Current token will last for {time_delta} "
- f"OAuth response message: {result['message']}"
- )
- else:
- logger.warning(
- "Invalid OAuth credentials. Unloading Games cog. "
- f"OAuth response message: {result['message']}"
- )
- self.bot.remove_cog("Games")
-
- return
-
- self.headers["Authorization"] = f"Bearer {result['access_token']}"
-
- # Attempt to renew before the token expires
- next_renewal = result["expires_in"] - ACCESS_TOKEN_RENEWAL_WINDOW
-
- time_delta = timedelta(seconds=next_renewal)
- logger.info(f"Successfully renewed access token. Refreshing again in {time_delta}")
-
- # This will be true the first time this loop runs.
- # Since we now have an access token, its safe to start this task.
- if self.genres == {}:
- self.refresh_genres_task.start()
- await sleep(next_renewal)
+ async def cog_load(self) -> None:
+ """Get an auth token and start the refresh task on cog load."""
+ await self.refresh_token()
+ self.refresh_genres_task.start()
+
+ async def refresh_token(self) -> None:
+ """
+ Refresh the IGDB V4 access token.
+
+ Once a new token has been created, schedule another refresh `ACCESS_TOKEN_RENEWAL_WINDOW` seconds before expiry.
+ """
+ async with self.http_session.post(OAUTH_URL, params=OAUTH_PARAMS) as resp:
+ result = await resp.json()
+ if resp.status != 200:
+ # If there is a valid access token continue to use that,
+ # otherwise unload cog.
+ if "Authorization" in self.headers:
+ time_delta = timedelta(seconds=ACCESS_TOKEN_RENEWAL_WINDOW)
+ logger.error(
+ "Failed to renew IGDB access token. "
+ f"Current token will last for {time_delta} "
+ f"OAuth response message: {result['message']}"
+ )
+ else:
+ logger.warning(
+ "Invalid OAuth credentials. Unloading Games cog. "
+ f"OAuth response message: {result['message']}"
+ )
+ self.bot.remove_cog("Games")
+ return
+
+ self.headers["Authorization"] = f"Bearer {result['access_token']}"
+
+ # Attempt to renew before the token expires
+ seconds_until_next_renewal = result["expires_in"] - ACCESS_TOKEN_RENEWAL_WINDOW
+ logger.info(f"Successfully renewed access token. Refreshing again in {seconds_until_next_renewal} seconds")
+ self.token_refresh_scheduler.schedule_later(seconds_until_next_renewal, __name__, self.refresh_token())
@tasks.loop(hours=24.0)
async def refresh_genres_task(self) -> None:
@@ -267,7 +265,7 @@ class Games(Cog):
"""
# When user didn't specified genre, send help message
if genre is None:
- await invoke_help_command(ctx)
+ await self.bot.invoke_help_command(ctx)
return
# Capitalize genre for check
@@ -505,7 +503,7 @@ class Games(Cog):
return sorted((item for item in results if item[0] >= 0.60), reverse=True)[:4]
-def setup(bot: Bot) -> None:
+async def setup(bot: Bot) -> None:
"""Load the Games cog."""
# Check does IGDB API key exist, if not, log warning and don't load cog
if not Tokens.igdb_client_id:
@@ -514,4 +512,4 @@ def setup(bot: Bot) -> None:
if not Tokens.igdb_client_secret:
logger.warning("No IGDB client secret. Not loading Games cog.")
return
- bot.add_cog(Games(bot))
+ await bot.add_cog(Games(bot))
diff --git a/bot/exts/fun/hangman.py b/bot/exts/fun/hangman.py
index a2c8c735..6c4ed69c 100644
--- a/bot/exts/fun/hangman.py
+++ b/bot/exts/fun/hangman.py
@@ -177,6 +177,6 @@ class Hangman(commands.Cog):
await ctx.send(embed=win_embed)
-def setup(bot: Bot) -> None:
+async def setup(bot: Bot) -> None:
"""Load the Hangman cog."""
- bot.add_cog(Hangman(bot))
+ await bot.add_cog(Hangman(bot))
diff --git a/bot/exts/fun/latex.py b/bot/exts/fun/latex.py
index aeabcd20..b5dada1c 100644
--- a/bot/exts/fun/latex.py
+++ b/bot/exts/fun/latex.py
@@ -133,6 +133,6 @@ class Latex(commands.Cog):
await ctx.send(file=discord.File(image_path, "latex.png"))
-def setup(bot: Bot) -> None:
+async def setup(bot: Bot) -> None:
"""Load the Latex Cog."""
- bot.add_cog(Latex(bot))
+ await bot.add_cog(Latex(bot))
diff --git a/bot/exts/fun/madlibs.py b/bot/exts/fun/madlibs.py
index 21708e53..5f3e0572 100644
--- a/bot/exts/fun/madlibs.py
+++ b/bot/exts/fun/madlibs.py
@@ -143,6 +143,6 @@ class Madlibs(commands.Cog):
error.handled = True
-def setup(bot: Bot) -> None:
+async def setup(bot: Bot) -> None:
"""Load the Madlibs cog."""
- bot.add_cog(Madlibs(bot))
+ await bot.add_cog(Madlibs(bot))
diff --git a/bot/exts/fun/magic_8ball.py b/bot/exts/fun/magic_8ball.py
index a7b682ca..95d711c4 100644
--- a/bot/exts/fun/magic_8ball.py
+++ b/bot/exts/fun/magic_8ball.py
@@ -25,6 +25,6 @@ class Magic8ball(commands.Cog):
await ctx.send("Usage: .8ball <question> (minimum length of 3 eg: `will I win?`)")
-def setup(bot: Bot) -> None:
+async def setup(bot: Bot) -> None:
"""Load the Magic8Ball Cog."""
- bot.add_cog(Magic8ball())
+ await bot.add_cog(Magic8ball())
diff --git a/bot/exts/fun/minesweeper.py b/bot/exts/fun/minesweeper.py
index a48b5051..f16b1db2 100644
--- a/bot/exts/fun/minesweeper.py
+++ b/bot/exts/fun/minesweeper.py
@@ -11,7 +11,6 @@ from bot.bot import Bot
from bot.constants import Client
from bot.utils.converters import CoordinateConverter
from bot.utils.exceptions import UserNotPlayingError
-from bot.utils.extensions import invoke_help_command
MESSAGE_MAPPING = {
0: ":stop_button:",
@@ -51,13 +50,14 @@ class Game:
class Minesweeper(commands.Cog):
"""Play a game of Minesweeper."""
- def __init__(self):
+ def __init__(self, bot: Bot):
+ self.bot = bot
self.games: dict[int, Game] = {}
@commands.group(name="minesweeper", aliases=("ms",), invoke_without_command=True)
async def minesweeper_group(self, ctx: commands.Context) -> None:
"""Commands for Playing Minesweeper."""
- await invoke_help_command(ctx)
+ await self.bot.invoke_help_command(ctx)
@staticmethod
def get_neighbours(x: int, y: int) -> Iterator[tuple[int, int]]:
@@ -265,6 +265,6 @@ class Minesweeper(commands.Cog):
del self.games[ctx.author.id]
-def setup(bot: Bot) -> None:
+async def setup(bot: Bot) -> None:
"""Load the Minesweeper cog."""
- bot.add_cog(Minesweeper())
+ await bot.add_cog(Minesweeper(bot))
diff --git a/bot/exts/fun/movie.py b/bot/exts/fun/movie.py
index a04eeb41..b6289887 100644
--- a/bot/exts/fun/movie.py
+++ b/bot/exts/fun/movie.py
@@ -9,7 +9,6 @@ from discord.ext.commands import Cog, Context, group
from bot.bot import Bot
from bot.constants import Tokens
-from bot.utils.extensions import invoke_help_command
from bot.utils.pagination import ImagePaginator
# Define base URL of TMDB
@@ -50,6 +49,7 @@ class Movie(Cog):
"""Movie Cog contains movies command that grab random movies from TMDB."""
def __init__(self, bot: Bot):
+ self.bot = bot
self.http_session: ClientSession = bot.http_session
@group(name="movies", aliases=("movie",), invoke_without_command=True)
@@ -73,7 +73,7 @@ class Movie(Cog):
try:
result = await self.get_movies_data(self.http_session, MovieGenres[genre].value, 1)
except KeyError:
- await invoke_help_command(ctx)
+ await self.bot.invoke_help_command(ctx)
return
# Check if "results" is in result. If not, throw error.
@@ -200,6 +200,6 @@ class Movie(Cog):
return embed
-def setup(bot: Bot) -> None:
+async def setup(bot: Bot) -> None:
"""Load the Movie Cog."""
- bot.add_cog(Movie(bot))
+ await bot.add_cog(Movie(bot))
diff --git a/bot/exts/fun/quack.py b/bot/exts/fun/quack.py
index 0c228aed..77080760 100644
--- a/bot/exts/fun/quack.py
+++ b/bot/exts/fun/quack.py
@@ -70,6 +70,6 @@ class Quackstack(commands.Cog):
await ctx.send(embed=embed)
-def setup(bot: Bot) -> None:
+async def setup(bot: Bot) -> None:
"""Loads the Quack cog."""
- bot.add_cog(Quackstack(bot))
+ await bot.add_cog(Quackstack(bot))
diff --git a/bot/exts/fun/recommend_game.py b/bot/exts/fun/recommend_game.py
index 42c9f7c2..e972b9a5 100644
--- a/bot/exts/fun/recommend_game.py
+++ b/bot/exts/fun/recommend_game.py
@@ -46,6 +46,6 @@ class RecommendGame(commands.Cog):
await ctx.send(embed=embed)
-def setup(bot: Bot) -> None:
+async def setup(bot: Bot) -> None:
"""Loads the RecommendGame cog."""
- bot.add_cog(RecommendGame(bot))
+ await bot.add_cog(RecommendGame(bot))
diff --git a/bot/exts/fun/rps.py b/bot/exts/fun/rps.py
index c6bbff46..50129835 100644
--- a/bot/exts/fun/rps.py
+++ b/bot/exts/fun/rps.py
@@ -52,6 +52,6 @@ class RPS(commands.Cog):
await ctx.send(f"Sir Lancebot played {bot_move}! {player_mention} lost!")
-def setup(bot: Bot) -> None:
+async def setup(bot: Bot) -> None:
"""Load the RPS Cog."""
- bot.add_cog(RPS(bot))
+ await bot.add_cog(RPS(bot))
diff --git a/bot/exts/fun/snakes/__init__.py b/bot/exts/fun/snakes/__init__.py
index ba8333fd..8aa39fb5 100644
--- a/bot/exts/fun/snakes/__init__.py
+++ b/bot/exts/fun/snakes/__init__.py
@@ -6,6 +6,6 @@ from bot.exts.fun.snakes._snakes_cog import Snakes
log = logging.getLogger(__name__)
-def setup(bot: Bot) -> None:
+async def setup(bot: Bot) -> None:
"""Load the Snakes Cog."""
- bot.add_cog(Snakes(bot))
+ await bot.add_cog(Snakes(bot))
diff --git a/bot/exts/fun/snakes/_snakes_cog.py b/bot/exts/fun/snakes/_snakes_cog.py
index 59e57199..96718200 100644
--- a/bot/exts/fun/snakes/_snakes_cog.py
+++ b/bot/exts/fun/snakes/_snakes_cog.py
@@ -22,7 +22,6 @@ from bot.constants import ERROR_REPLIES, Tokens
from bot.exts.fun.snakes import _utils as utils
from bot.exts.fun.snakes._converter import Snake
from bot.utils.decorators import locked
-from bot.utils.extensions import invoke_help_command
log = logging.getLogger(__name__)
@@ -440,7 +439,7 @@ class Snakes(Cog):
@group(name="snakes", aliases=("snake",), invoke_without_command=True)
async def snakes_group(self, ctx: Context) -> None:
"""Commands from our first code jam."""
- await invoke_help_command(ctx)
+ await self.bot.invoke_help_command(ctx)
@bot_has_permissions(manage_messages=True)
@snakes_group.command(name="antidote")
diff --git a/bot/exts/fun/space.py b/bot/exts/fun/space.py
index 48ad0f96..22a89050 100644
--- a/bot/exts/fun/space.py
+++ b/bot/exts/fun/space.py
@@ -11,7 +11,6 @@ from discord.ext.commands import Cog, Context, group
from bot.bot import Bot
from bot.constants import Tokens
from bot.utils.converters import DateConverter
-from bot.utils.extensions import invoke_help_command
logger = logging.getLogger(__name__)
@@ -27,6 +26,7 @@ class Space(Cog):
def __init__(self, bot: Bot):
self.http_session = bot.http_session
+ self.bot = bot
self.rovers = {}
self.get_rovers.start()
@@ -50,7 +50,7 @@ class Space(Cog):
@group(name="space", invoke_without_command=True)
async def space(self, ctx: Context) -> None:
"""Head command that contains commands about space."""
- await invoke_help_command(ctx)
+ await self.bot.invoke_help_command(ctx)
@space.command(name="apod")
async def apod(self, ctx: Context, date: Optional[str]) -> None:
@@ -227,10 +227,10 @@ class Space(Cog):
).set_image(url=image).set_footer(text="Powered by NASA API" + footer)
-def setup(bot: Bot) -> None:
+async def setup(bot: Bot) -> None:
"""Load the Space cog."""
if not Tokens.nasa:
logger.warning("Can't find NASA API key. Not loading Space Cog.")
return
- bot.add_cog(Space(bot))
+ await bot.add_cog(Space(bot))
diff --git a/bot/exts/fun/speedrun.py b/bot/exts/fun/speedrun.py
index c2966ce1..43e570a2 100644
--- a/bot/exts/fun/speedrun.py
+++ b/bot/exts/fun/speedrun.py
@@ -21,6 +21,6 @@ class Speedrun(commands.Cog):
await ctx.send(choice(LINKS))
-def setup(bot: Bot) -> None:
+async def setup(bot: Bot) -> None:
"""Load the Speedrun cog."""
- bot.add_cog(Speedrun())
+ await bot.add_cog(Speedrun())
diff --git a/bot/exts/fun/status_codes.py b/bot/exts/fun/status_codes.py
index 501cbe0a..cf544a19 100644
--- a/bot/exts/fun/status_codes.py
+++ b/bot/exts/fun/status_codes.py
@@ -82,6 +82,6 @@ class HTTPStatusCodes(commands.Cog):
)
-def setup(bot: Bot) -> None:
+async def setup(bot: Bot) -> None:
"""Load the HTTPStatusCodes cog."""
- bot.add_cog(HTTPStatusCodes(bot))
+ await bot.add_cog(HTTPStatusCodes(bot))
diff --git a/bot/exts/fun/tic_tac_toe.py b/bot/exts/fun/tic_tac_toe.py
index 5dd38a81..fa2a7531 100644
--- a/bot/exts/fun/tic_tac_toe.py
+++ b/bot/exts/fun/tic_tac_toe.py
@@ -333,6 +333,6 @@ class TicTacToe(Cog):
await ctx.send(embed=embed)
-def setup(bot: Bot) -> None:
+async def setup(bot: Bot) -> None:
"""Load the TicTacToe cog."""
- bot.add_cog(TicTacToe())
+ await bot.add_cog(TicTacToe())
diff --git a/bot/exts/fun/trivia_quiz.py b/bot/exts/fun/trivia_quiz.py
index 4a1cec5b..31652374 100644
--- a/bot/exts/fun/trivia_quiz.py
+++ b/bot/exts/fun/trivia_quiz.py
@@ -435,7 +435,7 @@ class TriviaQuiz(commands.Cog):
def contains_correct_answer(m: discord.Message) -> bool:
return m.channel == ctx.channel and any(
fuzz.ratio(answer.lower(), m.content.lower()) > variation_tolerance
- for answer in quiz_entry.answers
+ for answer in quiz_entry.answers # noqa: B023
)
return contains_correct_answer
@@ -670,6 +670,6 @@ class TriviaQuiz(commands.Cog):
await channel.send(embed=embed)
-def setup(bot: Bot) -> None:
+async def setup(bot: Bot) -> None:
"""Load the TriviaQuiz cog."""
- bot.add_cog(TriviaQuiz(bot))
+ await bot.add_cog(TriviaQuiz(bot))
diff --git a/bot/exts/fun/uwu.py b/bot/exts/fun/uwu.py
index 83497893..7a9d55d0 100644
--- a/bot/exts/fun/uwu.py
+++ b/bot/exts/fun/uwu.py
@@ -199,6 +199,6 @@ class Uwu(Cog):
await ctx.send(content=converted_text, embed=embed)
-def setup(bot: Bot) -> None:
+async def setup(bot: Bot) -> None:
"""Load the uwu cog."""
- bot.add_cog(Uwu(bot))
+ await bot.add_cog(Uwu(bot))
diff --git a/bot/exts/fun/wonder_twins.py b/bot/exts/fun/wonder_twins.py
index 79d6b6d9..0c5b0a76 100644
--- a/bot/exts/fun/wonder_twins.py
+++ b/bot/exts/fun/wonder_twins.py
@@ -44,6 +44,6 @@ class WonderTwins(Cog):
await ctx.send(f"Form of {self.format_phrase()}!")
-def setup(bot: Bot) -> None:
+async def setup(bot: Bot) -> None:
"""Load the WonderTwins cog."""
- bot.add_cog(WonderTwins())
+ await bot.add_cog(WonderTwins())
diff --git a/bot/exts/fun/xkcd.py b/bot/exts/fun/xkcd.py
index b56c53d9..380c3c80 100644
--- a/bot/exts/fun/xkcd.py
+++ b/bot/exts/fun/xkcd.py
@@ -86,6 +86,6 @@ class XKCD(Cog):
await ctx.send(embed=embed)
-def setup(bot: Bot) -> None:
+async def setup(bot: Bot) -> None:
"""Load the XKCD cog."""
- bot.add_cog(XKCD(bot))
+ await bot.add_cog(XKCD(bot))