mirror of
https://github.com/spacebarchat/server.git
synced 2026-10-22 13:12:19 +00:00
fix: assign id to poll answers
This commit is contained in:
1 parent
77124c559b
commit
4cf0e48dd0
4 files changed
+7
-1
No files matched your search
@@ -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]));
|
||||
|
||||
Reference in new issue
Block a user