浏览代码

Add more logging

ghorsington 4 年之前
父节点
当前提交
71a1b0ef70
共有 1 个文件被更改,包括 3 次插入1 次删除
  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;