Start work on pinned events

This commit is contained in:
Cadence Ember 2023-10-10 17:41:53 +13:00
commit 48d69c0539
9 changed files with 427 additions and 2 deletions

View file

@ -0,0 +1,18 @@
// @ts-check
const {select} = require("../../passthrough")
/**
* @param {import("discord-api-types/v10").RESTGetAPIChannelPinsResult} pins
*/
function pinsToList(pins) {
/** @type {string[]} */
const result = []
for (const message of pins) {
const eventID = select("event_message", "event_id", {message_id: message.id, part: 0}).pluck().get()
if (eventID) result.push(eventID)
}
return result
}
module.exports.pinsToList = pinsToList