no more logging about perma banned users

This commit is contained in:
2025-09-03 23:00:38 +02:00
parent 1634bb311e
commit 8b9239bedf

View File

@@ -35,8 +35,11 @@ streamerUsers.forEach(async id => await Promise.all([addAdmin(id), addInvuln(id)
const banned = await streamerApi.moderation.getBannedUsers(streamerId).then(a => a.data);
banned.forEach(async ban => {
await redis.set(`user:${ban.userId}:timeout`, '1');
if (ban.expiryDate) redis.expire(`user:${ban.userId}:timeout`, Math.floor((ban.expiryDate.getTime() - Date.now()) / 1000) + 1);
logger.info(`Set the timeout/ban of ${ban.userDisplayName} in the Redis/Valkey database.`);
const banlength = ban.expiryDate;
if (banlength) {
redis.expire(`user:${ban.userId}:timeout`, Math.floor((ban.expiryDate.getTime() - Date.now()) / 1000) + 1);
logger.info(`Set the timeout of ${ban.userDisplayName} in the Redis/Valkey database.`);
};
});
const mods = await streamerApi.moderation.getModerators(streamerId).then(a => a.data);