From b9b9d841c5fd032396d1d8752b4bc0d54e84b302 Mon Sep 17 00:00:00 2001 From: phixxy Date: Sat, 27 Jan 2024 16:49:50 -0800 Subject: [PATCH] removed blog from chatgpt added blog to phixxycom added permission for gpt4 queries --- extensions/chatgpt.py | 18 +----------------- extensions/phixxycom.py | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/extensions/chatgpt.py b/extensions/chatgpt.py index a7fab22..8fa2b9f 100644 --- a/extensions/chatgpt.py +++ b/extensions/chatgpt.py @@ -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) diff --git a/extensions/phixxycom.py b/extensions/phixxycom.py index 4726766..dec403d 100644 --- a/extensions/phixxycom.py +++ b/extensions/phixxycom.py @@ -196,6 +196,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()