forked from cadence/out-of-your-element
synchronise channel updates
This commit is contained in:
parent
3436759504
commit
08d3f3d804
3 changed files with 29 additions and 3 deletions
|
@ -252,8 +252,11 @@ async function createAllForGuild(guildID) {
|
|||
const channelIDs = discord.guildChannelMap.get(guildID)
|
||||
assert.ok(channelIDs)
|
||||
for (const channelID of channelIDs) {
|
||||
if (discord.channels.get(channelID)?.type === DiscordTypes.ChannelType.GuildText) { // TODO: guild sync thread channels and such. maybe make a helper function to check if a given channel is syncable?
|
||||
await syncRoom(channelID).then(r => console.log(`synced ${channelID}:`, r))
|
||||
const allowedTypes = [DiscordTypes.ChannelType.GuildText, DiscordTypes.ChannelType.PublicThread]
|
||||
// @ts-ignore
|
||||
if (allowedTypes.includes(discord.channels.get(channelID)?.type)) {
|
||||
const roomID = await syncRoom(channelID)
|
||||
console.log(`synced ${channelID} <-> ${roomID}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue