Update main.py

This commit is contained in:
7trail 2023-08-28 21:11:51 -05:00 committed by GitHub
parent 973d9ee7cf
commit e453796022
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -8,8 +8,6 @@ import random
import re
from discord import app_commands
from discord.ext import tasks
import keep_alive
from keep_alive import keep_alive
load_dotenv()
@ -136,14 +134,12 @@ async def FlushQueue():
if len(queue) > 0:
obj = queue.pop(0)
keep_alive.header = obj[1]
obj[1] = re.sub('[^A-Za-z0-9 ]+', '', obj[1])
log = client.get_channel(logChannel)
await log.send(f"**Now generating the {obj[0]} '{obj[1]}'**")
channel = client.get_channel(obj[3])
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)
keep_alive.body = c
if len(c) > 1900:
c2 = c[1899:(len(c)-1)]
c = c[0:1899]
@ -177,7 +173,5 @@ async def on_ready():
await log.send("Bot now online")
FlushQueue.start()
keep_alive()
bot_token = os.environ['BOT_TOKEN']
client.run(bot_token)