Explorar o código

Add more logging

ghorsington %!s(int64=3) %!d(string=hai) anos
pai
achega
71a1b0ef70
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      bot/src/rpc.ts

+ 3 - 1
bot/src/rpc.ts

@@ -31,7 +31,9 @@ async function checkUser(action: string, userId: string, check: (user: GuildMemb
         }
         const user = await tryDo(guildInstance.result.members.fetch(userId));
         if (!user.ok) {
-            logger.warn("Couldn't %s for user %s on server %s because: %s", action, userId, guild.guildId, user.error);
+            const userInfo = await tryDo(client.bot.users.fetch(userId));
+            const userName = userInfo.ok ? `${userInfo.result.username}#${userInfo.result.discriminator}` : "???";
+            logger.warn("Couldn't %s for user %s (%s) on server %s because: %s", action, userId, userName, guild.guildId, user.error);
         }
         if (user.ok && await check(user.result, guild)) {
             return true;