From 878b92313dc52263f92dfd7e0bcc33d424efd6a9 Mon Sep 17 00:00:00 2001 From: rtk-rnjn Date: Tue, 1 Aug 2023 11:39:29 +0530 Subject: [PATCH] fix add_line runtime error --- cogs/owner/owner.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/cogs/owner/owner.py b/cogs/owner/owner.py index 25dd3982..e2d97aac 100644 --- a/cogs/owner/owner.py +++ b/cogs/owner/owner.py @@ -16,8 +16,9 @@ from collections import Counter from typing import Annotated, Literal -import jishaku from aiofile import async_open +import jishaku +import jishaku.paginators # noqa: F401 from jishaku.paginators import PaginatorEmbedInterface from tabulate import tabulate @@ -639,14 +640,15 @@ def _join_values(values: list[str] | list[list[str]]) -> str: ) if steps := real.get("Steps"): - for step in steps: - await interface.add_line(f"# {step}") - if isinstance(step, str): - await interface.add_line(f"> {steps[step]}") - if isinstance(step, list): - for sub_step in step: + for hd, stps in steps.items(): + await interface.add_line(f"## {hd}") + if isinstance(steps, list): + for sub_step in stps: if sub_step.endswith("jpg"): await interface.add_line(f"- [Link To Image]({sub_step})") + if isinstance(sub_step, list): + for sub_sub_step in sub_step: + await interface.add_line(f" - {sub_sub_step}") else: await interface.add_line(f"- {sub_step}") await interface.add_line("") @@ -968,4 +970,3 @@ def check(m: discord.Message): deleted = await ctx.channel.purge(limit=search, check=check, before=ctx.message) # type: ignore return Counter(m.author.display_name for m in deleted) - return Counter(m.author.display_name for m in deleted)