aboutsummaryrefslogtreecommitdiffstats
path: root/bot/bot.py
diff options
context:
space:
mode:
authorGravatar Scragly <[email protected]>2019-03-26 13:53:54 +1000
committerGravatar Scragly <[email protected]>2019-03-26 13:53:54 +1000
commit79b16232c62c6381c1669718a718bba6acddc958 (patch)
tree456869a7e9470403974e45eb9e4823582f4ab62e /bot/bot.py
parentAdjust cog load logs to use cog class name. (diff)
Recombine error handlers into the main listener. Fix cooldown revert.
Diffstat (limited to 'bot/bot.py')
-rw-r--r--bot/bot.py17
1 files changed, 3 insertions, 14 deletions
diff --git a/bot/bot.py b/bot/bot.py
index c1198957..d60390c3 100644
--- a/bot/bot.py
+++ b/bot/bot.py
@@ -5,8 +5,7 @@ from typing import List
from aiohttp import AsyncResolver, ClientSession, TCPConnector
from discord import Embed
-from discord.ext import commands
-from discord.ext.commands import Bot, Cog
+from discord.ext.commands import Bot
from bot import constants
@@ -19,10 +18,7 @@ class SeasonalBot(Bot):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.http_session = ClientSession(
- connector=TCPConnector(
- resolver=AsyncResolver(),
- family=socket.AF_INET,
- )
+ connector=TCPConnector(resolver=AsyncResolver(), family=socket.AF_INET)
)
def load_extensions(self, exts: List[str]):
@@ -49,6 +45,7 @@ class SeasonalBot(Bot):
"""
Send an embed message to the devlog channel
"""
+
devlog = self.get_channel(constants.Channels.devlog)
if not devlog:
@@ -62,11 +59,3 @@ class SeasonalBot(Bot):
embed.set_author(name=title, icon_url=icon)
await devlog.send(embed=embed)
-
- @Cog.listener()
- async def on_command_error(self, context, exception):
- # Don't punish the user for getting the arguments wrong
- if isinstance(exception, commands.UserInputError):
- context.command.reset_cooldown(context)
- else:
- await super().on_command_error(context, exception)