mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-09 14:43:05 -04:00
reply support for chat
This commit is contained in:
parent
440c09eba3
commit
9feeed3b6e
1 changed files with 12 additions and 1 deletions
|
@ -30,9 +30,20 @@ module.exports = {
|
|||
context.triggerTyping();
|
||||
if(!args.text) return editOrReply(context, {embeds:[createEmbed("warning", context, `Missing Parameter (text).`)]})
|
||||
|
||||
let input = args.text;
|
||||
|
||||
let prompt = 'You are a friendly chat bot designed to help people. You should always use gender neutral pronouns when possible.'
|
||||
if(args.prompt !== "") prompt = args.prompt
|
||||
|
||||
if(context.message.messageReference) {
|
||||
let msg = await context.message.channel.fetchMessage(context.message.messageReference.messageId);
|
||||
if(msg.content && msg.content.length) input = msg.content
|
||||
else if(msg.embeds?.length) for(const e of msg.embeds) if(e[1].description?.length) { input = e[1].description; break; }
|
||||
|
||||
prompt = args.text
|
||||
if(args.prompt !== "") return editOrReply(context, {embeds:[createEmbed("warning", context, `Prompt parameter is unsupported for message replies.`)]})
|
||||
}
|
||||
|
||||
let model = "CHATGPT"
|
||||
let modelDisplay = ""
|
||||
if(args.model && isLimitedTestUser(context.user)){
|
||||
|
@ -56,7 +67,7 @@ module.exports = {
|
|||
})
|
||||
.send({
|
||||
prompt,
|
||||
input: [args.text],
|
||||
input: [input],
|
||||
temperature,
|
||||
model
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue