From b53d8d8b7fe7c33c6931fa9075c30c27ea9c02da Mon Sep 17 00:00:00 2001 From: sco1 Date: Sun, 3 Mar 2019 21:50:01 -0500 Subject: Add new Cog class inheritance & event listener decoration Mitigates recent breaking d.py changes --- bot/bot.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'bot/bot.py') diff --git a/bot/bot.py b/bot/bot.py index 12291a5f..84bac598 100644 --- a/bot/bot.py +++ b/bot/bot.py @@ -6,7 +6,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 +from discord.ext.commands import Bot, Cog from bot import constants @@ -63,6 +63,7 @@ class SeasonalBot(Bot): 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): -- cgit v1.2.3