let prevMessages = await message.channel.messages.fetch({ limit: 15 });
prevMessages.reverse();
await message.channel.sendTyping()
prevMessages.forEach((msg) => {
if (msg.author.id === message.author.id) {
conversationLog.push({
"role": "user",
"content": msg.content
});
} else if (msg.author.bot && /* is a reference to a message sent by the msg.author*/) {
conversationLog.push({
"role": "assistant",
"content": msg.content
});
}
});
let prevMessages = await message.channel.messages.fetch({ limit: 15 });
prevMessages.reverse();
await message.channel.sendTyping()
prevMessages.forEach((msg) => {
if (msg.author.id === message.author.id) {
conversationLog.push({
"role": "user",
"content": msg.content
});
} else if (msg.author.bot && /* is a reference to a message sent by the msg.author*/) {
conversationLog.push({
"role": "assistant",
"content": msg.content
});
}
});