fix: assign id to poll answers

This commit is contained in:
CyberL1
2026-06-24 14:06:48 +02:00
committed by Rory&
parent 77124c559b
commit 4cf0e48dd0
4 changed files with 7 additions and 1 deletions
Binary file not shown.
Binary file not shown.
+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]));
+1 -1
View File
@@ -32,7 +32,7 @@ export interface PollMedia {
}
export interface PollAnswer {
answer_id?: string;
answer_id?: number;
poll_media: PollMedia;
}