fix: assign id to poll answers

This commit is contained in:
CyberL1 authored and Rory& committed 2026-06-25 17:56:49 +02:00
1 parent 77124c559b
commit 4cf0e48dd0
4 files changed
+7 -1

No files matched your search

+6
View File
@@ -490,6 +490,12 @@ export async function handleMessage(opts: MessageOptions): Promise<Message> {
message.poll.expiry = new Date(Date.now() + opts.poll.duration * 3600000);
}
if (message.poll && opts.poll?.answers) {
for (let i = 0; i < opts.poll.answers.length; i++) {
message.poll.answers[i].answer_id = i;
}
}
await handleMessageMentionsAsync(message);
const attachmentIndices = new Map(message.attachments?.map((attachment, index) => [`attachment://${attachment.filename}`, index]));