diff options
| author | 2021-04-19 17:04:11 -0400 | |
|---|---|---|
| committer | 2021-04-19 17:04:11 -0400 | |
| commit | ae64ddd3e7d731a44a1684c93d67ea6334b120d2 (patch) | |
| tree | 8373f0171385d4065157ce0a4db5e686769ef272 /bot/exts/halloween/spookyrating.py | |
| parent | Merge pull request #673 from janine9vn/int-eval (diff) | |
Clean Up the Halloween Season
- Change commands.Bot type hints to bot.Bot
- Remove the setting of Cog.bot if it isn't being used
- Use Bot.http_session instead of creating new ones
- Keep string quotes and Doc-Strings consistant
- Remove redundant/outdated code
Ignored spookyavatar.py as it is being moved in another PR.
Diffstat (limited to 'bot/exts/halloween/spookyrating.py')
| -rw-r--r-- | bot/exts/halloween/spookyrating.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/bot/exts/halloween/spookyrating.py b/bot/exts/halloween/spookyrating.py index 6f069f8c..dc398e2e 100644 --- a/bot/exts/halloween/spookyrating.py +++ b/bot/exts/halloween/spookyrating.py @@ -7,20 +7,20 @@ from pathlib import Path import discord from discord.ext import commands +from bot.bot import Bot from bot.constants import Colours log = logging.getLogger(__name__) with Path("bot/resources/halloween/spooky_rating.json").open(encoding="utf8") as file: - SPOOKY_DATA = json.load(file) - SPOOKY_DATA = sorted((int(key), value) for key, value in SPOOKY_DATA.items()) + data = json.load(file) + SPOOKY_DATA = sorted((int(key), value) for key, value in data.items()) class SpookyRating(commands.Cog): """A cog for calculating one's spooky rating.""" - def __init__(self, bot: commands.Bot): - self.bot = bot + def __init__(self): self.local_random = random.Random() @commands.command() @@ -61,6 +61,6 @@ class SpookyRating(commands.Cog): await ctx.send(embed=embed) -def setup(bot: commands.Bot) -> None: - """Spooky Rating Cog load.""" - bot.add_cog(SpookyRating(bot)) +def setup(bot: Bot) -> None: + """Load the Spooky Rating Cog.""" + bot.add_cog(SpookyRating()) |