provide reply context to gemini

This commit is contained in:
bignutty 2024-12-22 22:40:41 +01:00
parent 9b4173a28a
commit 548588224a

View file

@ -32,6 +32,16 @@ module.exports = {
let input = args.text;
// Get content if the user replies to anything
if(context.message.messageReference) {
let msg = await context.message.channel.fetchMessage(context.message.messageReference.messageId);
if(msg.content && msg.content.length) input = `> ${msg.content.split("\n").join("\n> ")}\n${input}`
if(msg.embeds?.length) for(const e of msg.embeds) if(e[1].description?.length) { input = `> ${e[1].description.split("\n").join("\n> ")}\n${input}`; break; }
}
console.log(input)
try{
await editOrReply(context, createEmbed("ai_custom", context, STATIC_ICONS.ai_bard))