From 8b9239bedfd893c0e407fec97e06cabf92daca99 Mon Sep 17 00:00:00 2001 From: qwerinope Date: Wed, 3 Sep 2025 23:00:38 +0200 Subject: [PATCH] no more logging about perma banned users --- src/index.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index c059401..1193a41 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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);