mirror of
https://github.com/JonnyBro/JaBa.git
synced 2024-11-24 22:24:58 +05:00
Косметические изменения
This commit is contained in:
parent
fd6ba9c735
commit
f188dcd117
8 changed files with 53 additions and 36 deletions
|
@ -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()
|
||||||
|
|
|
@ -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);
|
||||||
});
|
});
|
||||||
|
|
|
@ -4,11 +4,11 @@ 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
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -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({
|
||||||
|
name: client.user.username,
|
||||||
|
iconURL: client.user.displayAvatarURL({
|
||||||
size: 512,
|
size: 512,
|
||||||
dynamic: true,
|
dynamic: true,
|
||||||
format: "png"
|
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
|
||||||
|
};
|
|
@ -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();
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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);
|
||||||
|
|
|
@ -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} `);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue