From cc6d6406afe96449aaf1aec6d6ca239061206df8 Mon Sep 17 00:00:00 2001 From: 7trail <72806227+7trail@users.noreply.github.com> Date: Tue, 5 Sep 2023 18:35:29 -0500 Subject: [PATCH] Improved monster gen --- main.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index 87256ec..36d3473 100644 --- a/main.py +++ b/main.py @@ -145,10 +145,13 @@ async def FlushQueue(): st = f"Create a DND 5e {obj[0]} named the '{obj[1]}'. {obj[2]} Keep the final text under 300 words. Use markdown text formatting." c = await generate.GetText(st) if len(c) > 1900: - c2 = c[1899:(len(c)-1)] - c = c[0:1899] - thread = await channel.create_thread(name = obj[1], content = c + " (Truncated)") - await thread.thread.send(c2) + + c3 = c[0:1899] + thread = await channel.create_thread(name = obj[1], content = c3 + " (Truncated)") + for i in range((len(c)//1900)): + f = 1899*(i+1) + c2 = c[f:min(len(c)-1,f+1900)] + await thread.thread.send(c2) if (obj[4]!=-1): await thread.thread.send("<@" + str(obj[4]) + ">") else: