diff --git a/src/quotes-server.ts b/src/quotes-server.ts index 6f9a268..01ee4c4 100644 --- a/src/quotes-server.ts +++ b/src/quotes-server.ts @@ -95,9 +95,9 @@ export async function attachQuotesServer(app: Express) { response.set("Content-Type", "application/json"); response.send( JSON.stringify({ - quotes: [...quotes.values()].sort( - (a, b) => b.timestamp.getTime() - a.timestamp.getTime(), - ), + quotes: [...quotes.entries()] + .map(([messageId, quote]) => ({ messageId, ...quote })) + .sort((a, b) => b.timestamp.getTime() - a.timestamp.getTime()), }), ); });