aboutsummaryrefslogtreecommitdiffstats
path: root/bot/bot.py
diff options
context:
space:
mode:
authorGravatar RohanJnr <[email protected]>2019-10-02 09:39:10 +0530
committerGravatar RohanJnr <[email protected]>2019-10-02 09:39:10 +0530
commitcd5842811f92bd5c82a164d33ad71a9c7c172e57 (patch)
tree4a15827a3d94cbc78fa8a9a5b47cdd57283f304e /bot/bot.py
parentWorked on the requested changes and also made a few other changes: (diff)
parentMerge branch 'master' into trivia_quiz (diff)
Merge branch 'trivia_quiz' of https://github.com/RohanJnr/seasonalbot into trivia_quiz
Diffstat (limited to 'bot/bot.py')
-rw-r--r--bot/bot.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/bot/bot.py b/bot/bot.py
index 86028838..2a723021 100644
--- a/bot/bot.py
+++ b/bot/bot.py
@@ -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)