diff options
| author | Andrew Lee <andrew@alee14.me> | 2025-03-08 23:11:48 -0500 |
|---|---|---|
| committer | Andrew Lee <andrew@alee14.me> | 2025-03-08 23:11:48 -0500 |
| commit | bdeef58376711e9a49c3b6f26aaf3fc65fa6200b (patch) | |
| tree | 55b4311fbdd71bf90d2f63bdccd01323757c31dd /bot/src/events/MessageCreate.js | |
| parent | 48a576ab5605ec3ec9272809668b8d7ce91c477e (diff) | |
| download | AleeBot-bdeef58376711e9a49c3b6f26aaf3fc65fa6200b.tar.gz AleeBot-bdeef58376711e9a49c3b6f26aaf3fc65fa6200b.tar.bz2 AleeBot-bdeef58376711e9a49c3b6f26aaf3fc65fa6200b.zip | |
Added file attachment fallback for delete and update (over 1024 characters); LLM response
Diffstat (limited to 'bot/src/events/MessageCreate.js')
| -rw-r--r-- | bot/src/events/MessageCreate.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/bot/src/events/MessageCreate.js b/bot/src/events/MessageCreate.js index 8753587..8234c5b 100644 --- a/bot/src/events/MessageCreate.js +++ b/bot/src/events/MessageCreate.js @@ -20,6 +20,8 @@ export default { if (!args) return msg.reply('Sorry? What was that?'); try { + const loadingMessage = await msg.reply('Thinking...'); + const response = await ollama.chat({ model: ollamaModel, messages: [{ role: 'user', content: args }], @@ -29,9 +31,9 @@ export default { if (content.length > 2000) { const attachment = new AttachmentBuilder(Buffer.from(content, 'utf-8'), { name: 'output.txt' }); - return await msg.reply({ files: [attachment] }); + return await loadingMessage.edit({ files: [attachment] }); } else { - return await msg.reply({ content }); + return await loadingMessage.edit({ content }); } } catch (err) { |
