Improved monster gen

This commit is contained in:
7trail 2023-09-05 18:35:29 -05:00 committed by GitHub
parent 66ca3b6310
commit cc6d6406af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

11
main.py
View file

@ -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." 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) c = await generate.GetText(st)
if len(c) > 1900: if len(c) > 1900:
c2 = c[1899:(len(c)-1)]
c = c[0:1899] c3 = c[0:1899]
thread = await channel.create_thread(name = obj[1], content = c + " (Truncated)") thread = await channel.create_thread(name = obj[1], content = c3 + " (Truncated)")
await thread.thread.send(c2) 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): if (obj[4]!=-1):
await thread.thread.send("<@" + str(obj[4]) + ">") await thread.thread.send("<@" + str(obj[4]) + ">")
else: else: