diff options
author | 2019-08-04 00:23:54 +0100 | |
---|---|---|
committer | 2019-08-04 00:23:54 +0100 | |
commit | 89184caa8aa236acecc34be251423f10e84ecf0a (patch) | |
tree | 76c11125184876e619563385a5d9c82d04e4dc2d /bot | |
parent | 8bitify (diff) |
Add annotations
Co-Authored-By: Sebastiaan Zeeff <[email protected]>
Diffstat (limited to 'bot')
-rw-r--r-- | bot/seasons/evergreen/8bitify.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/bot/seasons/evergreen/8bitify.py b/bot/seasons/evergreen/8bitify.py index ae732fe5..5ad68036 100644 --- a/bot/seasons/evergreen/8bitify.py +++ b/bot/seasons/evergreen/8bitify.py @@ -8,21 +8,21 @@ from discord.ext import commands class EightBitify(commands.Cog): """Make your avatar 8bit!""" - def __init__(self, bot): + def __init__(self, bot: commands.Bot) -> None: self.bot = bot @staticmethod - def pixelate(image: Image): + def pixelate(image: Image) -> Image: """Takes an image and pixelates it""" return image.resize((32, 32)).resize((1024, 1024)) @staticmethod - def quantize(image: Image): + def quantize(image: Image) -> Image: """Reduces colour palette to 256 colours""" return image.quantize(colors=32) @commands.command(name="8bitify") - async def eightbit_command(self, ctx): + async def eightbit_command(self, ctx: commands.Context) -> None: """Pixelates your avatar and changes the palette to an 8bit one""" async with ctx.typing(): image_bytes = await ctx.author.avatar_url.read() @@ -49,6 +49,6 @@ class EightBitify(commands.Cog): await ctx.send(file=file, embed=embed) -def setup(bot): +def setup(bot: commands.Bot) -> None: """Cog load.""" bot.add_cog(EightBitify(bot)) |