removed blog from chatgpt

added blog to phixxycom
added permission for gpt4 queries
This commit is contained in:
phixxy 2024-01-27 16:49:50 -08:00
parent 8c0c8578d2
commit b9b9d841c5
2 changed files with 17 additions and 17 deletions

View file

@ -145,22 +145,6 @@ class ChatGPT(commands.Cog):
else:
await ctx.send("Usage: !reactions (enable|disable)")
@commands.command(
description="Blog",
help="Adds your topic to the list of possible future blog topics. Usage: !suggest_blog (topic)",
brief="Suggest a blog topic"
)
async def blog(self, ctx, *args):
message = ' '.join(args)
if '\n' in message:
await ctx.send("Send only one topic at a time.")
return
else:
blogpost_file = "databases/blog_topics.txt"
with open(blogpost_file, 'a') as f:
f.writelines(message+'\n')
await ctx.send("Saved suggestion!")
@commands.command(
description="Question",
help="Ask a raw chatgpt question. Usage: !question (question)",
@ -181,7 +165,7 @@ class ChatGPT(commands.Cog):
async def question_gpt4(self, ctx):
if ctx.author.get_role(1200943915579228170):
question = ctx.message.content.split(" ", maxsplit=1)[1]
answer = await self.answer_question(question, "gpt-4-vision-preview")
answer = await self.answer_question(question, "gpt-4")
chunks = [answer[i:i+1999] for i in range(0, len(answer), 1999)]
for chunk in chunks:
await ctx.send(chunk)

View file

@ -197,6 +197,22 @@ class PhixxyCom(commands.Cog):
except Exception as error:
return None
@commands.command(
description="Blog",
help="Adds your topic to the list of possible future blog topics. Usage: !suggest_blog (topic)",
brief="Suggest a blog topic"
)
async def blog(self, ctx, *args):
message = ' '.join(args)
if '\n' in message:
await ctx.send("Send only one topic at a time.")
return
else:
blogpost_file = f"{self.data_dir}blog_topics.txt"
with open(blogpost_file, 'a') as f:
f.writelines(message+'\n')
await ctx.send("Saved suggestion!")
async def generate_blog(self):
start_time = time.time()
topic = ''