removed blog from chatgpt
added blog to phixxycom added permission for gpt4 queries
This commit is contained in:
parent
8c0c8578d2
commit
b9b9d841c5
2 changed files with 17 additions and 17 deletions
|
|
@ -145,22 +145,6 @@ class ChatGPT(commands.Cog):
|
||||||
else:
|
else:
|
||||||
await ctx.send("Usage: !reactions (enable|disable)")
|
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(
|
@commands.command(
|
||||||
description="Question",
|
description="Question",
|
||||||
help="Ask a raw chatgpt question. Usage: !question (question)",
|
help="Ask a raw chatgpt question. Usage: !question (question)",
|
||||||
|
|
@ -181,7 +165,7 @@ class ChatGPT(commands.Cog):
|
||||||
async def question_gpt4(self, ctx):
|
async def question_gpt4(self, ctx):
|
||||||
if ctx.author.get_role(1200943915579228170):
|
if ctx.author.get_role(1200943915579228170):
|
||||||
question = ctx.message.content.split(" ", maxsplit=1)[1]
|
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)]
|
chunks = [answer[i:i+1999] for i in range(0, len(answer), 1999)]
|
||||||
for chunk in chunks:
|
for chunk in chunks:
|
||||||
await ctx.send(chunk)
|
await ctx.send(chunk)
|
||||||
|
|
|
||||||
|
|
@ -196,6 +196,22 @@ class PhixxyCom(commands.Cog):
|
||||||
|
|
||||||
except Exception as error:
|
except Exception as error:
|
||||||
return None
|
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):
|
async def generate_blog(self):
|
||||||
start_time = time.time()
|
start_time = time.time()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue