Skip to content
Extraits de code Groupes Projets
Non vérifiée Valider 1169a09d rédigé par Sorunome's avatar Sorunome
Parcourir les fichiers

make chanfix go over guilds to not upload the guild icon for each channel

parent c7824315
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -61,7 +61,7 @@ export class ChannelSyncroniser {
}
}
public async OnGuildUpdate(guild: Discord.Guild) {
public async OnGuildUpdate(guild: Discord.Guild, force = false) {
log.verbose(`Got guild update for guild ${guild.id}`);
const channelStates = [];
for (const [_, channel] of guild.channels) {
......@@ -69,7 +69,7 @@ export class ChannelSyncroniser {
continue; // not supported for now
}
try {
const channelState = await this.GetChannelUpdateState(channel as Discord.TextChannel);
const channelState = await this.GetChannelUpdateState(channel as Discord.TextChannel, force);
channelStates.push(channelState);
} catch (e) {
log.error("Failed to get channel state", e);
......
......@@ -128,19 +128,13 @@ bridge.loadDatabases().catch((e) => {
let delay = config.limits.roomGhostJoinDelay; // we'll just re-use this
client.guilds.forEach((guild) => {
guild.channels.forEach((channel) => {
if (channel.type !== "text") {
return;
}
promiseChain = promiseChain.return(Bluebird.delay(delay).then(() => {
return chanSync.EnsureState(channel).catch((err) => {
log.warn(`Couldn't update rooms for ${channel.id}`, err);
return chanSync.OnGuildUpdate(guild, true).catch((err) => {
log.warn(`Couldn't update rooms of guild ${guild.id}`, err);
});
}));
delay += config.limits.roomGhostJoinDelay;
});
});
return promiseChain;
}).catch((err) => {
log.error(err);
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter