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

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

View file

@ -5,10 +5,10 @@ module.exports = {
* @param {object} client The Discord Client instance
*/
update(client) {
const table = require("markdown-table");
const fs = require("fs");
const commands = client.commands;
const categories = [];
const table = require("markdown-table"),
fs = require("fs"),
commands = client.commands,
categories = [];
commands.forEach((cmd) => {
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) {
new CronJob("0 8 * * *", async function () {
client.guilds.cache.forEach(async (guild) => {
const date = new Date();
const currentDay = date.getDate();
const currentMonth = date.getMonth();
const currentYear = date.getFullYear();
const guildData = await client.findOrCreateGuild({
id: guild.id
});
const date = new Date(),
currentDay = date.getDate(),
currentMonth = date.getMonth(),
currentYear = date.getFullYear(),
guildData = await client.findOrCreateGuild({
id: guild.id
});
if (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) {
const embed = new Discord.MessageEmbed()
.setAuthor({ name: client.user.username, iconURL: client.user.displayAvatarURL({
size: 512,
dynamic: true,
format: "png"
})})
.setAuthor({
name: client.user.username,
iconURL: client.user.displayAvatarURL({
size: 512,
dynamic: true,
format: "png"
})
})
.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", {
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"))}`
}));
const msg = await channel.send({ content: "@here", embeds: [embed] });
const msg = await channel.send({
embeds: [embed]
});
await msg.react("🎉");
}
}
@ -49,4 +56,6 @@ async function init(client) {
}, null, true, "Europe/Moscow");
}
module.exports = { init };
module.exports = {
init
};

View file

@ -25,14 +25,20 @@ module.exports = {
if (mustSent.length > 0) {
mustSent.forEach((r) => {
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", {
time: client.convertTime(r.createdAt, "from")
}))
.addField(client.translate("common:MESSAGE"), r.message)
.setColor(client.config.embed.color)
.setFooter({ text: client.config.embed.footer });
dUser.send({ embeds: [embed] });
.setFooter({
text: client.config.embed.footer
});
dUser.send({
embeds: [embed]
});
});
user.reminds = user.reminds.filter((r) => r.sendAt >= dateNow);
user.save();

View file

@ -1,9 +1,8 @@
const Discord = require("discord.js");
/* THIS CHECK IF THERE IS A USER TO UNMUTE */
module.exports = {
/**
* Starts checking...
* Check if there is a user to unmute
* @param {object} client The Discord Client instance
*/
async init(client) {
@ -47,9 +46,13 @@ module.exports = {
count: memberData.mute.case
}))
.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);
if (channel) channel.send({ embeds: [embed] });
if (channel) channel.send({
embeds: [embed]
});
memberData.mute = {
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) {
const guild = client.guilds.cache.get(client.config.support.id);
const member = guild.me;

View file

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

View file

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