d->m: Sync missed emojis/stickers after restart

This commit is contained in:
Cadence Ember 2024-01-10 23:56:10 +13:00
parent a67708269d
commit 9efd6a49b8
7 changed files with 140 additions and 85 deletions

View file

@ -125,6 +125,16 @@ module.exports = {
}
},
/**
* When logging back in, check if we missed any changes to emojis or stickers. Apply the changes if so.
* @param {import("./discord-client")} client
* @param {DiscordTypes.GatewayGuildCreateDispatchData} guild
*/
async checkMissedExpressions(guild) {
const data = {guild_id: guild.id, ...guild}
createSpace.syncSpaceExpressions(data, true)
},
/**
* Announces to the parent room that the thread room has been created.
* See notes.md, "Ignore MESSAGE_UPDATE and bridge THREAD_CREATE as the announcement"
@ -262,6 +272,6 @@ module.exports = {
* @param {DiscordTypes.GatewayGuildEmojisUpdateDispatchData | DiscordTypes.GatewayGuildStickersUpdateDispatchData} data
*/
async onExpressionsUpdate(client, data) {
await createSpace.syncSpaceExpressions(data)
await createSpace.syncSpaceExpressions(data, false)
}
}