Skip to content
Extraits de code Groupes Projets
Non vérifiée Valider e02671ac rédigé par László Károlyi's avatar László Károlyi
Parcourir les fichiers

Fix presence status error, fix client init

parent c29cfc72
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -43,7 +43,7 @@ export class DiscordClientFactory {
fetchAllMembers: this.config.usePrivilegedIntents,
messageCacheLifetime: 5,
ws: {
intents: this.config.usePrivilegedIntents ? Intents.PRIVILEGED : Intents.NON_PRIVILEGED,
intents: this.config.usePrivilegedIntents ? Intents.ALL : Intents.NON_PRIVILEGED,
},
});
......@@ -69,7 +69,7 @@ export class DiscordClientFactory {
fetchAllMembers: false,
messageCacheLifetime: 5,
ws: {
intents: Intents.NON_PRIVILEGED,
intents: this.config.usePrivilegedIntents ? Intents.ALL : Intents.NON_PRIVILEGED,
},
});
......@@ -102,7 +102,7 @@ export class DiscordClientFactory {
fetchAllMembers: false,
messageCacheLifetime: 5,
ws: {
intents: Intents.NON_PRIVILEGED,
intents: this.config.usePrivilegedIntents ? Intents.ALL : Intents.NON_PRIVILEGED,
},
});
......
......@@ -144,7 +144,7 @@ export class PresenceHandler {
const intent = this.bot.GetIntentFromDiscordMember(user);
try {
await intent.ensureRegistered();
await intent.underlyingClient.setPresenceStatus(status.Presence, status.StatusMsg);
await intent.underlyingClient.setPresenceStatus(status.Presence, status.StatusMsg || '');
} catch (ex) {
if (ex.errcode !== "M_FORBIDDEN") {
log.warn(`Could not update Matrix presence for ${user.id}`);
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter