diff options
Diffstat (limited to 'bot/exts/easter')
| -rw-r--r-- | bot/exts/easter/april_fools_vids.py | 2 | ||||
| -rw-r--r-- | bot/exts/easter/conversationstarters.py | 28 | ||||
| -rw-r--r-- | bot/exts/easter/egg_decorating.py | 4 | ||||
| -rw-r--r-- | bot/exts/easter/egg_facts.py | 7 | 
4 files changed, 7 insertions, 34 deletions
diff --git a/bot/exts/easter/april_fools_vids.py b/bot/exts/easter/april_fools_vids.py index 06108f02..efe7e677 100644 --- a/bot/exts/easter/april_fools_vids.py +++ b/bot/exts/easter/april_fools_vids.py @@ -20,7 +20,7 @@ class AprilFoolVideos(commands.Cog):      def load_json() -> dict:          """A function to load JSON data."""          p = Path('bot/resources/easter/april_fools_vids.json') -        with p.open() as json_file: +        with p.open(encoding="utf-8") as json_file:              all_vids = load(json_file)          return all_vids diff --git a/bot/exts/easter/conversationstarters.py b/bot/exts/easter/conversationstarters.py deleted file mode 100644 index a5f40445..00000000 --- a/bot/exts/easter/conversationstarters.py +++ /dev/null @@ -1,28 +0,0 @@ -import json -import logging -import random -from pathlib import Path - -from discord.ext import commands - -log = logging.getLogger(__name__) - -with open(Path("bot/resources/easter/starter.json"), "r", encoding="utf8") as f: -    starters = json.load(f) - - -class ConvoStarters(commands.Cog): -    """Easter conversation topics.""" - -    def __init__(self, bot: commands.Bot): -        self.bot = bot - -    @commands.command() -    async def topic(self, ctx: commands.Context) -> None: -        """Responds with a random topic to start a conversation.""" -        await ctx.send(random.choice(starters['starters'])) - - -def setup(bot: commands.Bot) -> None: -    """Conversation starters Cog load.""" -    bot.add_cog(ConvoStarters(bot)) diff --git a/bot/exts/easter/egg_decorating.py b/bot/exts/easter/egg_decorating.py index be228b2c..b18e6636 100644 --- a/bot/exts/easter/egg_decorating.py +++ b/bot/exts/easter/egg_decorating.py @@ -12,10 +12,10 @@ from discord.ext import commands  log = logging.getLogger(__name__) -with open(Path("bot/resources/evergreen/html_colours.json")) as f: +with open(Path("bot/resources/evergreen/html_colours.json"), encoding="utf8") as f:      HTML_COLOURS = json.load(f) -with open(Path("bot/resources/evergreen/xkcd_colours.json")) as f: +with open(Path("bot/resources/evergreen/xkcd_colours.json"), encoding="utf8") as f:      XKCD_COLOURS = json.load(f)  COLOURS = [ 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))  |