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()) %> +