mirror of
https://github.com/JonnyBro/JaBa.git
synced 2024-11-22 13:14:58 +05:00
D:
"Вчера работало, а сегодня уже нет"
This commit is contained in:
parent
1085d2107f
commit
e2065b4523
3 changed files with 8 additions and 8 deletions
|
@ -39,7 +39,7 @@ module.exports.load = async(client) => {
|
||||||
.use(async function(req, res, next) {
|
.use(async function(req, res, next) {
|
||||||
req.user = req.session.user;
|
req.user = req.session.user;
|
||||||
req.client = client;
|
req.client = client;
|
||||||
req.locale = req.user ? (req.user.locale === "ru" ? "ru-RU" : "en-US") : "en-US";
|
req.locale = req.user ? (req.user.locale === "ru" ? "ru-RU" : "uk-UA") : "ru-RU";
|
||||||
if (req.user && req.url !== "/") req.userInfos = await utils.fetchUser(req.user, req.client);
|
if (req.user && req.url !== "/") req.userInfos = await utils.fetchUser(req.user, req.client);
|
||||||
if (req.user) {
|
if (req.user) {
|
||||||
req.translate = req.client.translations.get(req.locale);
|
req.translate = req.client.translations.get(req.locale);
|
||||||
|
|
|
@ -28,14 +28,14 @@ async function fetchUser(userData, client, query) {
|
||||||
const userDb = await client.findOrCreateUser({
|
const userDb = await client.findOrCreateUser({
|
||||||
id: user.id
|
id: user.id
|
||||||
}, true);
|
}, true);
|
||||||
const guildData = await client.guilds.fetch(userData.guilds.filter(g => g.displayed)[0].id);
|
// const guildData = await client.guilds.fetch(userData.displayedGuilds[0].id);
|
||||||
const userPresence = guildData.members.cache.get(user.id).presence;
|
// const userPresence = guildData.members.cache.get(user.id).presence;
|
||||||
|
|
||||||
const userInfos = {
|
const userInfos = {
|
||||||
...user.toJSON(),
|
...user.toJSON(),
|
||||||
...userDb,
|
...userDb,
|
||||||
...userData,
|
...userData
|
||||||
...userPresence
|
// ...userPresence
|
||||||
};
|
};
|
||||||
|
|
||||||
return userInfos;
|
return userInfos;
|
||||||
|
|
|
@ -9,9 +9,9 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="pull-left info">
|
<div class="pull-left info">
|
||||||
<p><%= user.username %></p>
|
<p><%= user.username %></p>
|
||||||
<a href="#"><i class="fa fa-circle text-<%= user.status === "dnd" ? "danger" : user.status === "idle" ? "warning" : user.status === "online" ? "success" : ""%>"></i>
|
<!-- <a href="#"><i class="fa fa-circle text-<%=// user.status === "dnd" ? "danger" : user.status === "idle" ? "warning" : user.status === "online" ? "success" : ""%>"></i>
|
||||||
<%= translate("common:STATUS_" + user.status.toUpperCase()) %>
|
<%=// translate("common:STATUS_" + user.status.toUpperCase()) %>
|
||||||
</a>
|
</a> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- sidebar menu: style can be found in sidebar.less -->
|
<!-- sidebar menu: style can be found in sidebar.less -->
|
||||||
|
|
Loading…
Reference in a new issue