fix(PTC-W0031):

This commit is contained in:
Romain J 2020-10-21 00:09:47 +02:00
parent 4751a1b518
commit 969ff8c351
2 changed files with 13 additions and 13 deletions

View file

@ -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()

View file

@ -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(