mirror of
https://github.com/spacebarchat/server.git
synced 2026-07-03 11:12:13 +00:00
fix: assign id to poll answers
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -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]));
|
||||
|
||||
@@ -32,7 +32,7 @@ export interface PollMedia {
|
||||
}
|
||||
|
||||
export interface PollAnswer {
|
||||
answer_id?: string;
|
||||
answer_id?: number;
|
||||
poll_media: PollMedia;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user