Информация о профиле на сайте
This commit is contained in:
JonnyBro 2022-01-12 20:31:47 +05:00
parent 93a74149c4
commit fbd42b6fa5
12 changed files with 86 additions and 25 deletions

View file

@ -35,7 +35,7 @@ class Setafk extends Command {
const m = await message.success("general/setafk:SUCCESS", {
reason,
prefix: message.guild ? data.guild.prefix : "$"
prefix: message.guild ? data.guild.prefix : ""
});
setTimeout(() => {

View file

@ -43,6 +43,7 @@ module.exports.load = async(client) => {
if (req.user) {
req.translate = req.client.translations.get(req.locale);
req.printDate = (date) => req.client.printDate(date, null, req.locale);
req.convertTime = (time) => req.client.convertTime(time, "to", true, req.locale);
};
next();
})

View file

@ -16,12 +16,15 @@ router.get("/:serverID", CheckAuth, async(req, res) => {
// Fetch guild informations
const guildInfos = await utils.fetchGuild(guild.id, req.client, req.user.guilds);
const memberData = await req.client.findOrCreateMember({ id: req.userInfos.id, guildID: guild.id });
res.render("manager/guild", {
guild: guildInfos,
user: req.userInfos,
memberData: memberData,
translate: req.translate,
bot: req.client,
convertTime: req.convertTime,
currentURL: `${req.client.config.dashboard.baseURL}/${req.originalUrl}`
});
});

View file

@ -4,7 +4,7 @@ const express = require("express"),
// Gets profile page
router.get("/", CheckAuth, async function(req, res) {
res.render("settings", {
res.render("profile", {
user: req.userInfos,
translate: req.translate,
printDate: req.printDate,
@ -25,7 +25,7 @@ router.post("/", CheckAuth, async function(req, res) {
};
await user.save();
res.redirect(303, "/settings");
res.redirect(303, "/profile");
});
module.exports = router;

View file

@ -193,13 +193,20 @@
<div class="row">
<div class="col-md-12">
<pre class="brush: html">
-----------------------------------------------------------------------------------------
JaBa v3.2.7
-----------------------------------------------------------------------------------------
Добавлено
- Некоторая информация о вашем профиле на сайте, на страницах серверов и в настройках.
(Скоро там будет больше всякой информации).
-----------------------------------------------------------------------------------------
JaBa v3.2.6
-----------------------------------------------------------------------------------------
Исправления
- Команда goodbye снова работает.
Изменено
Изменения
- Команда setafk и ответ бота автоматически удаляются через 10 секунд.
- Новые карточки при входе и выходе пользователей
(Я не дизайнер, не бейте :( ).
@ -208,7 +215,7 @@
-----------------------------------------------------------------------------------------
JaBa v3.2.5
-----------------------------------------------------------------------------------------
Изменено
Изменения
- Переписана команда loop.
Теперь нужен аргумент song или queue для включения соответствующего режима повтора.
Если не указать агрумент, то повтор отключится.

View file

@ -44,7 +44,7 @@
<ul class="treeview-menu">
<% user.displayedGuilds.forEach((guild) => { %>
<li><a href="<%= guild.settingsUrl %>"><i
class="fa fa-circle-o text-<%= guild.owner ? "blue" : "grey" %>"></i>
class="fa fa-circle-o text-<%= guild.owner ? "green" : "grey" %>"></i>
<%= guild.name %></a></li>
<% }); %>
</ul>

View file

@ -29,8 +29,9 @@
<div class="row">
<div class="col-md-6">
<div class="box box-widget widget-user">
<div class="widget-user-header bg-aqua-active">
<div class="widget-user-header bg-red">
<h3 class="widget-user-username"><%= guild.name %></h3>
<i> <%= guild.id %> </i>
</div>
<div class="widget-user-image">
<img class="img-circle" src="<%= guild.iconURL %>" alt="Server icon">
@ -50,6 +51,38 @@
</div>
<!-- /.box-footer -->
</div>
<div class="info-box">
<span class="info-box-icon bg-green"><i class="fa fa-area-chart"></i></span>
<div class="info-box-content">
<span class="info-box-text"><%= translate("common:LEVEL") %></span>
<span class="info-box-number"><%= guild.members.find(u => u.id === user.id).level %></span>
</div>
<!-- /.info-box-content -->
</div>
<div class="info-box">
<span class="info-box-icon bg-green"><i class="fa fa-money"></i></span>
<div class="info-box-content">
<span class="info-box-text"><%= translate("common:CREDITS") %> / <%= translate("economy/transactions:BANK") %></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>
</div>
<!-- /.info-box-content -->
</div>
<!-- /.info-box -->
<div class="info-box">
<span class="info-box-icon bg-green"><i class="fa fa-refresh"></i></span>
<div class="info-box-content">
<span class="info-box-text"><%= translate("dashboard:COOLDOWNS") %></span>
<% for (const c in memberData.cooldowns) { %>
<% if (c !== "rob") { %>
<span class="info-box-number"><%= translate("dashboard:" + c.toUpperCase()) %>: <%= memberData.cooldowns[c] !== 0 ? convertTime(memberData.cooldowns[c]) : translate("dashboard:CAN_USE") %></span>
<% } else { %>
<span class="info-box-number"><%= translate("dashboard:" + c.toUpperCase()) %>: <%= memberData.cooldowns[c] !== 0 ? convertTime(memberData.cooldowns[c]) : translate("dashboard:NO_DEFENCE") %></span>
<% }; %>
<% }; %>
</div>
<!-- /.info-box-content -->
</div>
<!-- /.info-box -->
<!-- BASIC CONFIGURATION -->
<div class="box box-warning">
<div class="box-header with-border">

View file

@ -30,6 +30,15 @@
<!-- Info boxes -->
<div class="row">
<div class="col-md-12">
<div class="info-box">
<span class="info-box-icon bg-green"><i class="fa fa-star-o"></i></span>
<div class="info-box-content">
<span class="info-box-text"><%= translate("dashboard:REPUTATION") %></span>
<span class="info-box-number"><%= user.rep %></span>
</div>
<!-- /.info-box-content -->
</div>
<!-- /.info-box -->
<!-- general form elements -->
<div class="box box-primary">
<div class="box-header with-border">

View file

@ -31,7 +31,7 @@ module.exports = {
else return 1;
}).forEach((cmd) => {
arrCat.push([
`**${cmd.help.name}** ${cmd.help.aliases.length ? `**(${cmd.help.aliases.join(", ")})**` : ""}`,
`**${cmd.help.name}** ${cmd.help.aliases.length ? `**(${cmd.help.aliases.join(", ")})**` : ""} ${cmd.conf.guildOnly ? "*Только на сервере*" : ""}`,
client.translate(`${cmd.help.category.toLowerCase()}/${cmd.help.name}:DESCRIPTION`),
client.translate(`${cmd.help.category.toLowerCase()}/${cmd.help.name}:USAGE`),
`${Math.ceil(cmd.conf.cooldown / 1000)} ${client.getNoun(Math.ceil(cmd.conf.cooldown / 1000), "секунда", "секунды", "секунд")}`

View file

@ -21,5 +21,13 @@
"ENABLE_AUTOROLE": "Включить",
"DISABLE_AUTOROLE": "Выключить",
"SELECTOR": "Выбор серверов",
"MANAGE": "Управление"
"MANAGE": "Управление",
"REPUTATION": "Очки репутации",
"COOLDOWNS": "Откаты",
"REP": "Команда rep",
"WORK": "Зарплата в work",
"ROB": "Защита от rob",
"CAN_USE": "Можно использовать",
"NO_DEFENCE": "Вы беспомощны"
}

View file

@ -1,6 +1,6 @@
{
"name": "jaba",
"version": "3.2.6",
"version": "3.2.7",
"description": "A very complete Discord bot (more than 100 commands) that uses the Discord.js",
"main": "index.js",
"private": true,