forcing space sync will unbridge deleted channels

This commit is contained in:
Cadence Ember
2023-09-07 23:20:48 +12:00
parent 0237d45c60
commit 0acf59bf48
2 changed files with 12 additions and 4 deletions

View File

@@ -145,7 +145,11 @@ async function syncSpaceFully(guildID) {
for (const roomID of childRooms) {
const channelID = db.prepare("SELECT channel_id FROM channel_room WHERE room_id = ?").pluck().get(roomID)
if (!channelID) continue
await createRoom.syncRoom(channelID)
if (discord.channels.has(channelID)) {
await createRoom.syncRoom(channelID)
} else {
await createRoom.unbridgeDeletedChannel(channelID, guildID)
}
}
return spaceID