From 00428baf67f61f67ff45793c55101dc9cd63b6b7 Mon Sep 17 00:00:00 2001 From: aikaterna <20862007+aikaterna@users.noreply.github.com> Date: Thu, 24 Mar 2022 16:15:21 -0700 Subject: [PATCH] [Wolfram] Allow very long answers --- wolfram/wolfram.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/wolfram/wolfram.py b/wolfram/wolfram.py index 48f681c..0272b9b 100644 --- a/wolfram/wolfram.py +++ b/wolfram/wolfram.py @@ -6,13 +6,14 @@ import urllib.parse from redbot.core import Config, commands, checks from redbot.core.utils.chat_formatting import box, pagify +from redbot.core.utils.menus import menu, DEFAULT_CONTROLS class Wolfram(commands.Cog): """Ask Wolfram Alpha any question.""" async def red_delete_data_for_user(self, **kwargs): - """ Nothing to delete """ + """Nothing to delete.""" return def __init__(self, bot): @@ -50,7 +51,13 @@ class Wolfram(commands.Cog): if "Current geoip location" in message: message = "There is as yet insufficient data for a meaningful answer." - await ctx.send(box(message)) + if len(message) > 1990: + menu_pages = [] + for page in pagify(message, delims=[" | ", "\n"], page_length=1990): + menu_pages.append(box(page)) + await menu(ctx, menu_pages, DEFAULT_CONTROLS) + else: + await ctx.send(box(message)) @commands.command(name="wolframimage") async def _image(self, ctx, *arguments: str):