Merge pull request #143 from bobloy/fifo_long_lists

Fix very long lists
pull/146/head
bobloy 4 years ago committed by GitHub
commit 9ea57ee99a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

Loading…
Cancel
Save