mirror of
https://github.com/JonnyBro/JaBa.git
synced 2024-11-21 20:54: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) {
|
||||
req.user = req.session.user;
|
||||
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.translate = req.client.translations.get(req.locale);
|
||||
|
|
|
@ -28,14 +28,14 @@ async function fetchUser(userData, client, query) {
|
|||
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 guildData = await client.guilds.fetch(userData.displayedGuilds[0].id);
|
||||
// const userPresence = guildData.members.cache.get(user.id).presence;
|
||||
|
||||
const userInfos = {
|
||||
...user.toJSON(),
|
||||
...userDb,
|
||||
...userData,
|
||||
...userPresence
|
||||
...userData
|
||||
// ...userPresence
|
||||
};
|
||||
|
||||
return userInfos;
|
||||
|
|
|
@ -9,9 +9,9 @@
|
|||
</div>
|
||||
<div class="pull-left info">
|
||||
<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>
|
||||
<%= translate("common:STATUS_" + user.status.toUpperCase()) %>
|
||||
</a>
|
||||
<!-- <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()) %>
|
||||
</a> -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- sidebar menu: style can be found in sidebar.less -->
|
||||
|
|
Loading…
Reference in a new issue