Фиксы

This commit is contained in:
JonnyBro 2022-01-13 22:53:33 +05:00
parent 3ffabbf6a1
commit 25983d2c27
3 changed files with 13 additions and 12 deletions

View file

@ -13,9 +13,9 @@ router.get("/:userID/:serverID", CheckAuth, async function (req, res) {
currentURL: `${req.client.config.dashboard.baseURL}${req.originalUrl}` currentURL: `${req.client.config.dashboard.baseURL}${req.originalUrl}`
}); });
} }
const guildData = await req.client.findOrCreateGuild({ id: guild.id }); const guildData = await req.client.findOrCreateGuild({ id: guild.id });
await utils.fetchUser({
const userInfos = await utils.fetchUser({
id: req.params.userID id: req.params.userID
}, req.client).catch(() => { }, req.client).catch(() => {
res.render("404", { res.render("404", {
@ -27,6 +27,7 @@ router.get("/:userID/:serverID", CheckAuth, async function (req, res) {
res.render("user", { res.render("user", {
user: req.userInfos, user: req.userInfos,
userInfos: userInfos,
guild: guildData, guild: guildData,
bot: req.client, bot: req.client,
translate: req.translate, translate: req.translate,

View file

@ -27,19 +27,19 @@
<div class="box box-widget widget-user"> <div class="box box-widget widget-user">
<!-- Add the bg color to the header using any of the bg-* classes --> <!-- Add the bg color to the header using any of the bg-* classes -->
<div class="widget-user-header bg-red"> <div class="widget-user-header bg-red">
<h3 class="widget-user-username"><%= user.tag %></h3> <h3 class="widget-user-username"><%= userInfos.tag %></h3>
<i><%= bot.guilds.cache.get(guild.id).name %></i> <i><%= bot.guilds.cache.get(guild.id).name %></i>
<p> <i>ID: <%= guild.id %></i> </p> <p> <i>ID: <%= guild.id %></i> </p>
</div> </div>
<div class="widget-user-image"> <div class="widget-user-image">
<img class="img-circle" src="<%= user.displayAvatarURL %>" alt="User Avatar"> <img class="img-circle" src="<%= userInfos.displayAvatarURL %>" alt="User Avatar">
</div> </div>
<div class="box-footer"> <div class="box-footer">
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12">
<div class="description-block"> <div class="description-block">
<span <span
class="description-text"><%= user.bio || translate("economy/profile:NO_BIO") %></span> class="description-text"><%= userInfos.bio || translate("economy/profile:NO_BIO") %></span>
</div> </div>
</div> </div>
<div class="col-sm-4 border-right"> <div class="col-sm-4 border-right">
@ -47,7 +47,7 @@
<h5 class="description-header"> <h5 class="description-header">
<%= translate("economy/profile:BIRTHDATE").substr(2) %></h5> <%= translate("economy/profile:BIRTHDATE").substr(2) %></h5>
<span <span
class="description-text"><%= user.birthdate ? printDate(new Date(user.birthdate)) : translate("economy/profile:NO_BIRTHDATE") %></span> class="description-text"><%= userInfos.birthdate ? printDate(new Date(userInfos.birthdate)) : translate("economy/profile:NO_BIRTHDATE") %></span>
</div> </div>
<!-- /.description-block --> <!-- /.description-block -->
</div> </div>
@ -56,7 +56,7 @@
<div class="description-block"> <div class="description-block">
<h5 class="description-header"><%= translate("economy/profile:REGISTERED").substr(2) %></h5> <h5 class="description-header"><%= translate("economy/profile:REGISTERED").substr(2) %></h5>
<span <span
class="description-text"><%= printDate(new Date(user.registeredAt)) %></span> class="description-text"><%= printDate(new Date(userInfos.registeredAt)) %></span>
</div> </div>
<!-- /.description-block --> <!-- /.description-block -->
</div> </div>
@ -66,7 +66,7 @@
<h5 class="description-header"> <h5 class="description-header">
<%= translate("economy/profile:LOVER").substr(2) %></h5> <%= translate("economy/profile:LOVER").substr(2) %></h5>
<span <span
class="description-text"><%= !user.lover ? translate("economy/profile:NO_LOVER") : bot.users.cache.get(user.lover).tag %></span> class="description-text"><%= !userInfos.lover ? translate("economy/profile:NO_LOVER") : bot.users.cache.get(userInfos.lover).tag %></span>
</div> </div>
<!-- /.description-block --> <!-- /.description-block -->
</div> </div>
@ -86,7 +86,7 @@
<div class="info-box-content"> <div class="info-box-content">
<span <span
class="info-box-text"><%= translate("economy/profile:LEVEL").substr(2) %></span> class="info-box-text"><%= translate("economy/profile:LEVEL").substr(2) %></span>
<span class="info-box-number"><%= guild.members.find(u => u.id === user.id).level %></span> <span class="info-box-number"><%= guild.members.find(u => u.id === userInfos.id).level %></span>
</div> </div>
<!-- /.info-box-content --> <!-- /.info-box-content -->
</div> </div>
@ -100,7 +100,7 @@
<div class="info-box-content"> <div class="info-box-content">
<span <span
class="info-box-text"><%= translate("economy/profile:CASH").substr(2) %> / <%= translate("economy/profile:BANK").substr(2) %></span> class="info-box-text"><%= translate("economy/profile:CASH").substr(2) %> / <%= translate("economy/profile:BANK").substr(2) %></span>
<span class="info-box-number"><%= guild.members.find(u => u.id === user.id).money %> / <%= guild.members.find(u => u.id === user.id).bankSold %></span> <span class="info-box-number"><%= guild.members.find(u => u.id === userInfos.id).money %> / <%= guild.members.find(u => u.id === userInfos.id).bankSold %></span>
</div> </div>
<!-- /.info-box-content --> <!-- /.info-box-content -->
</div> </div>
@ -113,7 +113,7 @@
<div class="info-box-content"> <div class="info-box-content">
<span class="info-box-text"><%= translate("economy/profile:REPUTATION").substr(2) %></span> <span class="info-box-text"><%= translate("economy/profile:REPUTATION").substr(2) %></span>
<span class="info-box-number"><%= user.rep %></span> <span class="info-box-number"><%= userInfos.rep %></span>
</div> </div>
<!-- /.info-box-content --> <!-- /.info-box-content -->
</div> </div>

View file

@ -1,6 +1,6 @@
{ {
"DESCRIPTION": "Установить дату рождения", "DESCRIPTION": "Установить дату рождения",
"USAGE": "{{prefix}}birthdate [дата]", "USAGE": "{{prefix}}birthdate [ДД/ММ/ГГГГ]",
"EXAMPLES": "{{prefix}}birthdate 01/01/2010", "EXAMPLES": "{{prefix}}birthdate 01/01/2010",
"MISSING_DATE": "Укажите дату в формате 20/11/2003", "MISSING_DATE": "Укажите дату в формате 20/11/2003",
"INVALID_DATE": "Используйте данный формат: ДД/ММ/ГГГГ. Например, `1 января 2010` будет `01/01/2010`.", "INVALID_DATE": "Используйте данный формат: ДД/ММ/ГГГГ. Например, `1 января 2010` будет `01/01/2010`.",