Fix converting discord channel links

This commit is contained in:
Cadence Ember
2025-10-10 12:26:01 -06:00
parent 5b7433de32
commit cffd3c9f2e
5 changed files with 102 additions and 7 deletions
+2 -2
View File
@@ -408,13 +408,13 @@ async function messageToEvent(message, guild, options = {}, di) {
async function transformParsedVia(parsed) {
for (const node of parsed) {
if (node.type === "discordChannel") {
if (node.type === "discordChannel" || node.type === "discordChannelLink") {
node.row = select("channel_room", ["room_id", "name", "nick"], {channel_id: node.id}).get()
if (node.row?.room_id) {
node.via = await getViaServersMemo(node.row.room_id)
}
}
;for (const maybeChildNodesArray of [node, node.content, node.items]) {
for (const maybeChildNodesArray of [node, node.content, node.items]) {
if (Array.isArray(maybeChildNodesArray)) {
await transformParsedVia(maybeChildNodesArray)
}