From 608f4259658aaa1d46d0bbb8df939c280bbcd460 Mon Sep 17 00:00:00 2001 From: bobloy Date: Wed, 23 Sep 2020 12:15:53 -0400 Subject: [PATCH] Fix very long lists --- fifo/fifo.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fifo/fifo.py b/fifo/fifo.py index e84e342..91c9190 100644 --- a/fifo/fifo.py +++ b/fifo/fifo.py @@ -10,6 +10,7 @@ from apscheduler.schedulers.base import STATE_PAUSED, STATE_RUNNING from redbot.core import Config, checks, commands from redbot.core.bot import Red from redbot.core.commands import TimedeltaConverter +from redbot.core.utils.chat_formatting import pagify from .datetime_cron_converters import CronConverter, DatetimeConverter from .task import Task @@ -306,7 +307,11 @@ class FIFO(commands.Cog): out += f"{task_name}: {task_data}\n" if out: - await ctx.maybe_send_embed(out) + if len(out) > 2000: + for page in pagify(out): + await ctx.maybe_send_embed(page) + else: + await ctx.maybe_send_embed(out) else: await ctx.maybe_send_embed("No tasks to list")