Косметические изменения

This commit is contained in:
JonnyBro 2022-01-14 18:20:27 +05:00
parent fd6ba9c735
commit f188dcd117
8 changed files with 53 additions and 36 deletions

View file

@ -42,7 +42,7 @@ class Leaderboard extends Command {
const user = (await this.client.users.fetch(data.id)).tag; const user = (await this.client.users.fetch(data.id)).tag;
userNames += `**${i + 1}**. ${user}\n`; userNames += `**${i + 1}**. ${user}\n`;
money += `**${data.money}**\n`; money += `${data.money}\n`;
} }
const embed = new Discord.MessageEmbed() const embed = new Discord.MessageEmbed()
@ -89,8 +89,8 @@ class Leaderboard extends Command {
const user = (await this.client.users.fetch(data.id)).tag; const user = (await this.client.users.fetch(data.id)).tag;
userNames += `**${i + 1}**. ${user}\n`; userNames += `**${i + 1}**. ${user}\n`;
level += `**${data.level}**\n`; level += `${data.level}\n`;
xp += `**${data.xp}** / **${5 * (data.level * data.level) + 80 * data.level + 100}**\n`; xp += `${data.xp} / ${5 * (data.level * data.level) + 80 * data.level + 100}\n`;
} }
const embed = new Discord.MessageEmbed() const embed = new Discord.MessageEmbed()
@ -139,7 +139,7 @@ class Leaderboard extends Command {
const user = (await this.client.users.fetch(data.id)).tag; const user = (await this.client.users.fetch(data.id)).tag;
userNames += `**${i + 1}**. ${user}\n`; userNames += `**${i + 1}**. ${user}\n`;
rep += `**${data.rep}**\n`; rep += `${data.rep}\n`;
} }
const embed = new Discord.MessageEmbed() const embed = new Discord.MessageEmbed()

View file

@ -5,10 +5,10 @@ module.exports = {
* @param {object} client The Discord Client instance * @param {object} client The Discord Client instance
*/ */
update(client) { update(client) {
const table = require("markdown-table"); const table = require("markdown-table"),
const fs = require("fs"); fs = require("fs"),
const commands = client.commands; commands = client.commands,
const categories = []; categories = [];
commands.forEach((cmd) => { commands.forEach((cmd) => {
if (!categories.includes(cmd.help.category)) categories.push(cmd.help.category); if (!categories.includes(cmd.help.category)) categories.push(cmd.help.category);
}); });

View file

@ -4,13 +4,13 @@ const CronJob = require("cron").CronJob,
async function init(client) { async function init(client) {
new CronJob("0 8 * * *", async function () { new CronJob("0 8 * * *", async function () {
client.guilds.cache.forEach(async (guild) => { client.guilds.cache.forEach(async (guild) => {
const date = new Date(); const date = new Date(),
const currentDay = date.getDate(); currentDay = date.getDate(),
const currentMonth = date.getMonth(); currentMonth = date.getMonth(),
const currentYear = date.getFullYear(); currentYear = date.getFullYear(),
const guildData = await client.findOrCreateGuild({ guildData = await client.findOrCreateGuild({
id: guild.id id: guild.id
}); });
if (guildData.plugins.birthdays) { if (guildData.plugins.birthdays) {
const channel = client.channels.cache.get(guildData.plugins.birthdays); const channel = client.channels.cache.get(guildData.plugins.birthdays);
@ -27,18 +27,25 @@ async function init(client) {
if (currentMonth === month && currentDay === day) { if (currentMonth === month && currentDay === day) {
const embed = new Discord.MessageEmbed() const embed = new Discord.MessageEmbed()
.setAuthor({ name: client.user.username, iconURL: client.user.displayAvatarURL({ .setAuthor({
size: 512, name: client.user.username,
dynamic: true, iconURL: client.user.displayAvatarURL({
format: "png" size: 512,
})}) dynamic: true,
format: "png"
})
})
.setColor(client.config.embed.color) .setColor(client.config.embed.color)
.setFooter({ text: client.config.embed.footer }) .setFooter({
text: client.config.embed.footer
})
.addField(client.translate("economy/birthdate:HAPPY_BIRTHDAY"), client.translate("economy/birthdate:HAPPY_BIRTHDAY_MESSAGE", { .addField(client.translate("economy/birthdate:HAPPY_BIRTHDAY"), client.translate("economy/birthdate:HAPPY_BIRTHDAY_MESSAGE", {
user: user.id, user: user.id,
age: `${age} ${client.getNoun(age, client.translate("misc:NOUNS:AGE:1"), client.translate("misc:NOUNS:AGE:2"), client.translate("misc:NOUNS:AGE:5"))}` age: `${age} ${client.getNoun(age, client.translate("misc:NOUNS:AGE:1"), client.translate("misc:NOUNS:AGE:2"), client.translate("misc:NOUNS:AGE:5"))}`
})); }));
const msg = await channel.send({ content: "@here", embeds: [embed] }); const msg = await channel.send({
embeds: [embed]
});
await msg.react("🎉"); await msg.react("🎉");
} }
} }
@ -49,4 +56,6 @@ async function init(client) {
}, null, true, "Europe/Moscow"); }, null, true, "Europe/Moscow");
} }
module.exports = { init }; module.exports = {
init
};

View file

@ -25,14 +25,20 @@ module.exports = {
if (mustSent.length > 0) { if (mustSent.length > 0) {
mustSent.forEach((r) => { mustSent.forEach((r) => {
const embed = new Discord.MessageEmbed() const embed = new Discord.MessageEmbed()
.setAuthor({ name: client.translate("general/remindme:TITLE") }) .setAuthor({
name: client.translate("general/remindme:TITLE")
})
.addField(client.translate("common:CREATION"), client.translate("general/remindme:CREATED", { .addField(client.translate("common:CREATION"), client.translate("general/remindme:CREATED", {
time: client.convertTime(r.createdAt, "from") time: client.convertTime(r.createdAt, "from")
})) }))
.addField(client.translate("common:MESSAGE"), r.message) .addField(client.translate("common:MESSAGE"), r.message)
.setColor(client.config.embed.color) .setColor(client.config.embed.color)
.setFooter({ text: client.config.embed.footer }); .setFooter({
dUser.send({ embeds: [embed] }); text: client.config.embed.footer
});
dUser.send({
embeds: [embed]
});
}); });
user.reminds = user.reminds.filter((r) => r.sendAt >= dateNow); user.reminds = user.reminds.filter((r) => r.sendAt >= dateNow);
user.save(); user.save();

View file

@ -1,9 +1,8 @@
const Discord = require("discord.js"); const Discord = require("discord.js");
/* THIS CHECK IF THERE IS A USER TO UNMUTE */
module.exports = { module.exports = {
/** /**
* Starts checking... * Check if there is a user to unmute
* @param {object} client The Discord Client instance * @param {object} client The Discord Client instance
*/ */
async init(client) { async init(client) {
@ -47,9 +46,13 @@ module.exports = {
count: memberData.mute.case count: memberData.mute.case
})) }))
.setColor("#f44271") .setColor("#f44271")
.setFooter({ text: guild.client.config.embed.footer }); .setFooter({
text: guild.client.config.embed.footer
});
const channel = guild.channels.cache.get(guildData.plugins.modlogs); const channel = guild.channels.cache.get(guildData.plugins.modlogs);
if (channel) channel.send({ embeds: [embed] }); if (channel) channel.send({
embeds: [embed]
});
memberData.mute = { memberData.mute = {
muted: false, muted: false,

View file

@ -31,7 +31,7 @@ module.exports = {
} }
}, },
// This function return a actual link to the support server // This function return an actual link to the support server
async supportLink(client) { async supportLink(client) {
const guild = client.guilds.cache.get(client.config.support.id); const guild = client.guilds.cache.get(client.config.support.id);
const member = guild.me; const member = guild.me;

View file

@ -1,7 +1,7 @@
const i18next = require("i18next"); const i18next = require("i18next"),
const Backend = require("i18next-node-fs-backend"); Backend = require("i18next-node-fs-backend"),
const path = require("path"); path = require("path"),
const fs = require("fs").promises; fs = require("fs").promises;
async function walkDirectory(dir, namespaces = [], folderName = "") { async function walkDirectory(dir, namespaces = [], folderName = "") {
const files = await fs.readdir(dir); const files = await fs.readdir(dir);

View file

@ -24,7 +24,6 @@ module.exports = class Logger {
static log(content, type = "log") { static log(content, type = "log") {
const date = `[${format(new Date(Date.now()))}]:`; const date = `[${format(new Date(Date.now()))}]:`;
switch (type) { switch (type) {
// Check the message type and then print him in the console
case "log": { case "log": {
return console.log(`${date} ${bgBlue(type.toUpperCase())} ${content} `); return console.log(`${date} ${bgBlue(type.toUpperCase())} ${content} `);
} }