From 0df1e56d8b50d416da99fd6caeeef60ee989b2a7 Mon Sep 17 00:00:00 2001 From: JonnyBro Date: Mon, 14 Feb 2022 00:24:48 +0500 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=BB=D0=B3=D0=BE=D0=B6=D0=B4?= =?UTF-8?q?=D0=B0=D0=BD=D0=BD=D1=8B=D0=B9=20=D1=84=D0=B8=D0=BA=D1=81=20?= =?UTF-8?q?=D1=81=D1=82=D0=B0=D1=82=D1=83=D1=81=D0=B0=20=D0=BD=D0=B0=20?= =?UTF-8?q?=D1=81=D0=B0=D0=B9=D1=82=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dashboard/utils.js | 9 +++++++-- dashboard/views/includes/sidebar.ejs | 5 ++++- languages/ru-RU/common.json | 2 +- languages/uk-UA/common.json | 2 +- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/dashboard/utils.js b/dashboard/utils.js index 66b502d9..8497c5d1 100644 --- a/dashboard/utils.js +++ b/dashboard/utils.js @@ -20,17 +20,22 @@ async function fetchUser(userData, client, query) { guild.iconURL = (guild.icon ? `https://cdn.discordapp.com/icons/${guild.id}/${guild.icon}.png?size=128` : "https://discordemoji.com/assets/emoji/discordcry.png"); guild.displayed = (query ? guild.name.toLowerCase().includes(query.toLowerCase()) : true); }); - userData.displayedGuilds = userData.guilds.filter((g) => g.displayed && g.admin); + userData.displayedGuilds = userData.guilds.filter(g => g.displayed && g.admin); if (userData.displayedGuilds.length < 1) delete userData.displayedGuilds; } + const user = await client.users.fetch(userData.id); const userDb = await client.findOrCreateUser({ id: user.id }, true); + const guildData = await client.guilds.fetch(userData.guilds.filter(g => g.displayed)[0].id); + const userPresence = guildData.members.cache.get(user.id).presence; + const userInfos = { ...user.toJSON(), ...userDb, - ...userData + ...userData, + ...userPresence }; return userInfos; diff --git a/dashboard/views/includes/sidebar.ejs b/dashboard/views/includes/sidebar.ejs index 3349fd28..aa59b2d5 100644 --- a/dashboard/views/includes/sidebar.ejs +++ b/dashboard/views/includes/sidebar.ejs @@ -9,9 +9,12 @@

<%= user.username %>

+ "> + <%= translate("common:STATUS_" + user.status.toUpperCase()) %> +
- +