fix: check if attachments is an array

This commit is contained in:
MARCROCK22 2025-04-27 13:02:53 -04:00
parent 5a90b7edb4
commit e8e89e60a8

View File

@ -196,7 +196,7 @@ export class BaseInteraction<
poll: poll ? (poll instanceof PollBuilder ? poll.toJSON() : poll) : undefined,
};
if ('attachments' in body) {
if (Array.isArray(body.attachments)) {
payload.attachments =
body.attachments?.map((x, i) => ({
id: x.id ?? i.toString(),