diff options
author | 2019-09-09 13:22:09 -0400 | |
---|---|---|
committer | 2019-09-09 15:00:38 -0400 | |
commit | bd03db75805d02da2088ec5067993aa5f23184ae (patch) | |
tree | 4038157164a5d4eaf918870ed3063eda22421816 /bot/bot.py | |
parent | Add flake8-annotations to dev dependencies (diff) |
Initial linting pass
Bot root, seasons cog, easter cogs, evergreen cogs, halloween cogs
Diffstat (limited to 'bot/bot.py')
-rw-r--r-- | bot/bot.py | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -4,7 +4,7 @@ from traceback import format_exc from typing import List from aiohttp import AsyncResolver, ClientSession, TCPConnector -from discord import Embed +from discord import DiscordException, Embed from discord.ext import commands from bot.constants import Channels, Client @@ -23,7 +23,7 @@ class SeasonalBot(commands.Bot): connector=TCPConnector(resolver=AsyncResolver(), family=socket.AF_INET) ) - def load_extensions(self, exts: List[str]): + def load_extensions(self, exts: List[str]) -> None: """Unload all current extensions, then load the given extensions.""" # Unload all cogs extensions = list(self.extensions.keys()) @@ -40,7 +40,7 @@ class SeasonalBot(commands.Bot): except Exception as e: log.error(f'Failed to load extension {cog}: {repr(e)} {format_exc()}') - async def send_log(self, title: str, details: str = None, *, icon: str = None): + async def send_log(self, title: str, details: str = None, *, icon: str = None) -> None: """Send an embed message to the devlog channel.""" devlog = self.get_channel(Channels.devlog) @@ -56,7 +56,7 @@ class SeasonalBot(commands.Bot): await devlog.send(embed=embed) - async def on_command_error(self, context, exception): + async def on_command_error(self, context: commands.Context, exception: DiscordException) -> None: """Check command errors for UserInputError and reset the cooldown if thrown.""" if isinstance(exception, commands.UserInputError): context.command.reset_cooldown(context) |