From 969ff8c35174c0d6267ecf421a57fa0f1ac82f28 Mon Sep 17 00:00:00 2001 From: Romain J Date: Wed, 21 Oct 2020 00:09:47 +0200 Subject: [PATCH] fix(PTC-W0031): --- tuxbot/core/bot.py | 24 ++++++++++++------------ tuxbot/core/utils/functions/extra.py | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/tuxbot/core/bot.py b/tuxbot/core/bot.py index f97d6b4..4103215 100644 --- a/tuxbot/core/bot.py +++ b/tuxbot/core/bot.py @@ -120,13 +120,13 @@ class Tux(commands.AutoShardedBot): last_run=datetime.datetime.timestamp(self.uptime), ) - self._progress.get("main").stop_task( - self._progress.get("tasks")["connecting"] + self._progress["main"].stop_task( + self._progress["tasks"]["connecting"] ) - self._progress.get("main").remove_task( - self._progress.get("tasks")["connecting"] + self._progress["main"].remove_task( + self._progress["tasks"]["connecting"] ) - self._progress.get("tasks").pop("connecting") + self._progress["tasks"].pop("connecting") console.clear() console.print( @@ -257,16 +257,16 @@ class Tux(commands.AutoShardedBot): active=False, ) - for task in self._progress.get("tasks").keys(): - self._progress.get("main").log("Shutting down", task) + for task in self._progress["tasks"].keys(): + self._progress["main"].log("Shutting down", task) - self._progress.get("main").stop_task( - self._progress.get("tasks")[task] + self._progress["main"].stop_task( + self._progress["tasks"][task] ) - self._progress.get("main").remove_task( - self._progress.get("tasks")["connecting"] + self._progress["main"].remove_task( + self._progress["tasks"]["connecting"] ) - self._progress.get("main").stop() + self._progress["main"].stop() pending = [ t for t in asyncio.all_tasks() if t is not asyncio.current_task() diff --git a/tuxbot/core/utils/functions/extra.py b/tuxbot/core/utils/functions/extra.py index f7c070e..44897db 100644 --- a/tuxbot/core/utils/functions/extra.py +++ b/tuxbot/core/utils/functions/extra.py @@ -18,7 +18,7 @@ class ContextPlus(commands.Context): self.bot.config.Core.token, TOKEN_REPLACEMENT ) if kwargs.get("embed"): - embed = kwargs.get("embed").to_dict() + embed = kwargs["embed"].to_dict() for key, value in embed.items(): if isinstance(value, (str, bytes)): embed[key] = value.replace(