From 0687ee3f06a2ec197d240f46b5a049ac1a5a9525 Mon Sep 17 00:00:00 2001 From: Romain J Date: Thu, 28 Jan 2021 10:39:54 +0100 Subject: [PATCH] fix(import): add missing requirement --- setup.cfg | 2 +- tuxbot/cogs/Logs/logs.py | 6 +++++- tuxbot/core/utils/functions/extra.py | 12 ++++++++++-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/setup.cfg b/setup.cfg index d2639f6..abc3c1c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -23,7 +23,7 @@ install_requires = humanize>=2.6.0 ipinfo>=4.1.0 ipwhois>=1.2.0 - jishaku>=1.19.1.200 + jishaku @ git+https://github.com/Gorialis/jishaku psutil>=5.7.2 pydig>=0.3.0 requests>=2.25.1 diff --git a/tuxbot/cogs/Logs/logs.py b/tuxbot/cogs/Logs/logs.py index c89a17b..a5e71a2 100644 --- a/tuxbot/cogs/Logs/logs.py +++ b/tuxbot/cogs/Logs/logs.py @@ -73,12 +73,16 @@ class Logs(commands.Cog, name="Logs"): traces_sample_rate=1.0, environment=self.bot.instance_name, debug=False, + attach_stacktrace=True, ) def cog_unload(self): self.bot.on_error = self.old_on_error - async def on_error(self, event): + async def on_error(self, event, *args, **kwargs): + self.bot.console.log("Error!") + self.bot.console.log(args) + self.bot.console.log(kwargs) raise event # ========================================================================= diff --git a/tuxbot/core/utils/functions/extra.py b/tuxbot/core/utils/functions/extra.py index 221513c..c84254f 100644 --- a/tuxbot/core/utils/functions/extra.py +++ b/tuxbot/core/utils/functions/extra.py @@ -127,9 +127,17 @@ class ContextPlus(commands.Context): return self.bot.session def __repr__(self): - items = ("%s = %r" % (k, v) for k, v in self.__dict__.items()) + items = ( + "message=%s" % self.message, + "channel=%s" % self.channel, + "guild=%s" % self.guild, + "author=%s" % self.author, + "prefix=%s" % self.prefix, + "args=%s" % self.args, + "kwargs=%s" % self.kwargs, + ) - return "<%s: {%s}>" % (self.__class__.__name__, ", ".join(items)) + return "<%s %s>" % (self.__class__.__name__, ", ".join(items)) class CommandPLus(commands.Command):