[AbortError]: Request aborted

ok so when channel.send(etc...) returns an [AbortError]: Request aborted, it acrtually sends the message up to 3 times sometimes twice the channel. Further more, when channel.send(etc...) is ran and before it sends the message, if i stop the bot and restart it, it will persist sending the message it was sending before i stopped the bot. Why? How do i prevent that?

Here is the piece of the code:
const attachmentToSend = new AttachmentBuilder(filePath);
await channel.send({ files: [attachmentToSend] }).catch(error);
Was this page helpful?