diff options
| -rw-r--r-- | bot/__main__.py | 3 | ||||
| -rw-r--r-- | bot/bot.py | 9 | ||||
| -rw-r--r-- | bot/constants.py | 7 | ||||
| -rw-r--r-- | bot/seasons/easter/egg_hunt/cog.py | 3 | ||||
| -rw-r--r-- | bot/seasons/easter/egg_hunt/constants.py | 3 | ||||
| -rw-r--r-- | bot/seasons/season.py | 3 | 
6 files changed, 15 insertions, 13 deletions
diff --git a/bot/__main__.py b/bot/__main__.py index a3b68ec1..416bca35 100644 --- a/bot/__main__.py +++ b/bot/__main__.py @@ -1,6 +1,7 @@  import logging -from bot.constants import Client, bot +from bot.bot import bot +from bot.constants import Client  log = logging.getLogger(__name__) @@ -7,11 +7,11 @@ from aiohttp import AsyncResolver, ClientSession, TCPConnector  from discord import Embed  from discord.ext import commands -from bot import constants +from bot.constants import Channels, Client  log = logging.getLogger(__name__) -__all__ = ('SeasonalBot',) +__all__ = ('SeasonalBot', 'bot')  class SeasonalBot(commands.Bot): @@ -42,7 +42,7 @@ class SeasonalBot(commands.Bot):      async def send_log(self, title: str, details: str = None, *, icon: str = None):          """Send an embed message to the devlog channel.""" -        devlog = self.get_channel(constants.Channels.devlog) +        devlog = self.get_channel(Channels.devlog)          if not devlog:              log.warning("Log failed to send. Devlog channel not found.") @@ -62,3 +62,6 @@ class SeasonalBot(commands.Bot):              context.command.reset_cooldown(context)          else:              await super().on_command_error(context, exception) + + +bot = SeasonalBot(command_prefix=Client.prefix) diff --git a/bot/constants.py b/bot/constants.py index 8902d918..f46f21d6 100644 --- a/bot/constants.py +++ b/bot/constants.py @@ -2,11 +2,9 @@ import logging  from os import environ  from typing import NamedTuple -from bot.bot import SeasonalBot -  __all__ = (      "AdventOfCode", "Channels", "Client", "Colours", "Emojis", "Hacktoberfest", "Roles", -    "Tokens", "ERROR_REPLIES", "bot" +    "Tokens", "ERROR_REPLIES",  )  log = logging.getLogger(__name__) @@ -130,6 +128,3 @@ ERROR_REPLIES = [      "Noooooo!!",      "I can't believe you've done this",  ] - - -bot = SeasonalBot(command_prefix=Client.prefix) diff --git a/bot/seasons/easter/egg_hunt/cog.py b/bot/seasons/easter/egg_hunt/cog.py index 30fd3284..a4ad27df 100644 --- a/bot/seasons/easter/egg_hunt/cog.py +++ b/bot/seasons/easter/egg_hunt/cog.py @@ -9,7 +9,8 @@ from pathlib import Path  import discord  from discord.ext import commands -from bot.constants import Channels, Client, Roles as MainRoles, bot +from bot.bot import bot +from bot.constants import Channels, Client, Roles as MainRoles  from bot.decorators import with_role  from .constants import Colours, EggHuntSettings, Emoji, Roles diff --git a/bot/seasons/easter/egg_hunt/constants.py b/bot/seasons/easter/egg_hunt/constants.py index c7d9818b..02f6e9f2 100644 --- a/bot/seasons/easter/egg_hunt/constants.py +++ b/bot/seasons/easter/egg_hunt/constants.py @@ -2,7 +2,8 @@ import os  from discord import Colour -from bot.constants import Channels, Client, bot +from bot.bot import bot +from bot.constants import Channels, Client  GUILD = bot.get_guild(Client.guild) diff --git a/bot/seasons/season.py b/bot/seasons/season.py index 3b623040..c88ef2a7 100644 --- a/bot/seasons/season.py +++ b/bot/seasons/season.py @@ -12,7 +12,8 @@ import async_timeout  import discord  from discord.ext import commands -from bot.constants import Channels, Client, Roles, bot +from bot.bot import bot +from bot.constants import Channels, Client, Roles  from bot.decorators import with_role  log = logging.getLogger(__name__)  |