feat: set me_voted for poll messages

This commit is contained in:
CyberL1
2026-06-25 17:56:49 +02:00
committed by Rory&
parent 0efdb5c35a
commit eae999789c
@@ -46,6 +46,7 @@ import {
MessageCreateCloudAttachment,
MessageCreateSchema,
PartialUser,
PollAnswerCount,
PublicMessage,
Reaction,
ReadStateType,
@@ -213,6 +214,13 @@ router.get(
return att;
}) ?? [];
(x.poll?.results?.answer_counts as (PollAnswerCount & { voters?: string[] })[]).map((answer) => {
answer.me_voted = answer.voters!.includes(req.user_id);
delete answer.voters;
return answer;
});
/**
Some clients ( discord.js ) only check if a property exists within the response,
which causes errors when, say, the `application` property is `null`.