Beautify code

This commit is contained in:
JonnyBro 2022-01-04 00:35:11 +05:00
parent 5b608c2f60
commit 29448ffc93
69 changed files with 682 additions and 301 deletions

View file

@ -26,8 +26,12 @@ class Addemoji extends Command {
message.guild.emojis message.guild.emojis
.create(URL, name) .create(URL, name)
.then(emoji => message.success("administration/addemoji:SUCCESS", { emojiName: `<:${emoji.name}:${emoji.id}>` })) .then(emoji => message.success("administration/addemoji:SUCCESS", {
.catch(() => message.error("administration/addemoji:ERROR", { emojiName: name })); emojiName: `<:${emoji.name}:${emoji.id}>`
}))
.catch(() => message.error("administration/addemoji:ERROR", {
emojiName: name
}));
} }
}; };

View file

@ -78,7 +78,9 @@ class Backup extends Command {
backup.fetch(backupID).then(async (backupInfos) => { backup.fetch(backupID).then(async (backupInfos) => {
const embed = new Discord.MessageEmbed() const embed = new Discord.MessageEmbed()
.setAuthor({ name: message.translate("administration/backup:TITLE_INFO") }) .setAuthor({
name: message.translate("administration/backup:TITLE_INFO")
})
// Display the backup ID // Display the backup ID
.addField(message.translate("administration/backup:TITLE_ID"), backupInfos.id, true) .addField(message.translate("administration/backup:TITLE_ID"), backupInfos.id, true)
// Displays the server from which this backup comes // Displays the server from which this backup comes
@ -88,8 +90,35 @@ class Backup extends Command {
// Display when the backup was created // Display when the backup was created
.addField(message.translate("administration/backup:TITLE_CREATED_AT"), message.printDate(new Date(backupInfos.data.createdTimestamp)), true) .addField(message.translate("administration/backup:TITLE_CREATED_AT"), message.printDate(new Date(backupInfos.data.createdTimestamp)), true)
.setColor(data.config.embed.color) .setColor(data.config.embed.color)
.setFooter({ text: data.config.embed.footer }); .setFooter({
message.channel.send({ embeds: [embed] }); text: data.config.embed.footer
});
message.channel.send({
embeds: [embed]
});
}).catch(() => {
// if the backup wasn't found
return message.error("administration/backup:NO_BACKUP_FOUND", {
backupID
});
});
} else if (status === "remove") {
const backupID = args[1];
if (!backupID) return message.error("administration/backup:MISSING_BACKUP_ID");
backup.fetch(backupID).then(async () => {
message.sendT("administration/backup:CONFIRMATION");
await message.channel.awaitMessages(m => (m.author.id === message.author.id) && (m.content === "confirm"), {
max: 1,
time: 20000,
errors: ["time"]
}).catch(() => {
// if the author of the commands does not confirm the backup loading
return message.error("administration/backup:TIMES_UP");
});
backup.remove(backupID);
message.success("administration/backup:SUCCESS_REMOVED");
}).catch(() => { }).catch(() => {
// if the backup wasn't found // if the backup wasn't found
return message.error("administration/backup:NO_BACKUP_FOUND", { return message.error("administration/backup:NO_BACKUP_FOUND", {

View file

@ -21,9 +21,14 @@ class Configuration extends Command {
const guildData = data.guild; const guildData = data.guild;
const embed = new Discord.MessageEmbed() const embed = new Discord.MessageEmbed()
.setAuthor({ name: message.guild.name, iconURL: message.guild.iconURL() }) .setAuthor({
name: message.guild.name,
iconURL: message.guild.iconURL()
})
.setColor(data.config.embed.color) .setColor(data.config.embed.color)
.setFooter({ text: data.config.embed.footer }); .setFooter({
text: data.config.embed.footer
});
// Guild prefix // Guild prefix
embed.addField(message.translate("administration/configuration:PREFIX_TITLE"), guildData.prefix); embed.addField(message.translate("administration/configuration:PREFIX_TITLE"), guildData.prefix);
@ -85,7 +90,9 @@ class Configuration extends Command {
// Dashboard link // Dashboard link
embed.addField(message.translate("administration/configuration:DASHBOARD_TITLE"), `[${message.translate("administration/configuration:DASHBOARD_CONTENT")}](${this.client.config.dashboard.baseURL})`); embed.addField(message.translate("administration/configuration:DASHBOARD_TITLE"), `[${message.translate("administration/configuration:DASHBOARD_CONTENT")}](${this.client.config.dashboard.baseURL})`);
message.channel.send({ embeds: [embed] }); message.channel.send({
embeds: [embed]
});
} }
}; };

View file

@ -50,7 +50,8 @@ class Goodbye extends Command {
}); });
const filter = m => m.author.id === message.author.id; const filter = m => m.author.id === message.author.id;
const collector = message.channel.createMessageCollector({ filter, const collector = message.channel.createMessageCollector({
filter,
time: 120000 // 2 minutes time: 120000 // 2 minutes
}); });

View file

@ -65,7 +65,9 @@ class Setfortniteshop extends Command {
}) })
.setImage("attachment://shop.png") .setImage("attachment://shop.png")
.setColor(data.config.embed.color) .setColor(data.config.embed.color)
.setFooter({ text: data.config.embed.footer }); .setFooter({
text: data.config.embed.footer
});
const msg = await channel.send({ const msg = await channel.send({
embeds: [embed], embeds: [embed],
files: [attachment] files: [attachment]

View file

@ -50,7 +50,8 @@ class Welcome extends Command {
}); });
const filter = m => m.author.id === message.author.id; const filter = m => m.author.id === message.author.id;
const collector = message.channel.createMessageCollector({ filter, const collector = message.channel.createMessageCollector({
filter,
time: 120000 // 2 minutes time: 120000 // 2 minutes
}); });

View file

@ -19,9 +19,13 @@ class Achievements extends Command {
async run(message, args, data) { async run(message, args, data) {
const embed = new Discord.MessageEmbed() const embed = new Discord.MessageEmbed()
.setAuthor({ name: message.translate("economy/achievements:TITLE") }) .setAuthor({
name: message.translate("economy/achievements:TITLE")
})
.setColor(data.config.embed.color) .setColor(data.config.embed.color)
.setFooter({ text: data.config.embed.footer }); .setFooter({
text: data.config.embed.footer
});
embed.addField(message.translate("economy/achievements:SEND_CMD"), message.translate("economy/achievements:PROGRESS", { embed.addField(message.translate("economy/achievements:SEND_CMD"), message.translate("economy/achievements:PROGRESS", {
now: data.userData.achievements.firstCommand.progress.now, now: data.userData.achievements.firstCommand.progress.now,
@ -59,7 +63,9 @@ class Achievements extends Command {
percent: Math.round(100 * (data.userData.achievements.invite.progress.now / data.userData.achievements.invite.progress.total)) percent: Math.round(100 * (data.userData.achievements.invite.progress.now / data.userData.achievements.invite.progress.total))
})); }));
message.channel.send({ embeds: [embed] }); message.channel.send({
embeds: [embed]
});
} }
}; };

View file

@ -28,9 +28,7 @@ class Deposit extends Command {
amount = parseInt(amount, 10); amount = parseInt(amount, 10);
}; };
if (data.memberData.money < amount) return message.error("economy/deposit:NOT_ENOUGH_CREDIT", { if (data.memberData.money < amount) return message.error("economy/deposit:NOT_ENOUGH_CREDIT", { money: `**${amount}** ${message.getNoun(amount, message.translate("misc:NOUNS:CREDIT:1"), message.translate("misc:NOUNS:CREDIT:2"), message.translate("misc:NOUNS:CREDIT:5"))}` });
money: `**${amount}** ${message.getNoun(amount, message.translate("misc:NOUNS:CREDIT:1"), message.translate("misc:NOUNS:CREDIT:2"), message.translate("misc:NOUNS:CREDIT:5"))}`
});
data.memberData.money = data.memberData.money - amount; data.memberData.money = data.memberData.money - amount;
data.memberData.bankSold = data.memberData.bankSold + amount; data.memberData.bankSold = data.memberData.bankSold + amount;

View file

@ -37,7 +37,9 @@ class Leaderboard extends Command {
table.setHeading("#", message.translate("common:USER"), message.translate("common:CREDITS")); table.setHeading("#", message.translate("common:USER"), message.translate("common:CREDITS"));
if (membersLeaderboard.length > 20) membersLeaderboard.length = 20; if (membersLeaderboard.length > 20) membersLeaderboard.length = 20;
const newTable = await fetchUsers(membersLeaderboard, table, this.client); const newTable = await fetchUsers(membersLeaderboard, table, this.client);
message.channel.send({ content: `\`\`\`\n${newTable.toString()}\`\`\`` }); message.channel.send({
content: `\`\`\`\n${newTable.toString()}\`\`\``
});
} else if (type === "level") { } else if (type === "level") {
const members = await this.client.membersData.find({ const members = await this.client.membersData.find({
guildID: message.guild.id guildID: message.guild.id
@ -52,9 +54,15 @@ class Leaderboard extends Command {
table.setHeading("#", message.translate("common:USER"), message.translate("common:LEVEL")); table.setHeading("#", message.translate("common:USER"), message.translate("common:LEVEL"));
if (membersLeaderboard.length > 20) membersLeaderboard.length = 20; if (membersLeaderboard.length > 20) membersLeaderboard.length = 20;
const newTable = await fetchUsers(membersLeaderboard, table, this.client); const newTable = await fetchUsers(membersLeaderboard, table, this.client);
message.channel.send({ content: `\`\`\`\n${newTable.toString()}\`\`\`` }); message.channel.send({
content: `\`\`\`\n${newTable.toString()}\`\`\``
});
} else if (type === "rep") { } else if (type === "rep") {
const users = await this.client.usersData.find({ rep: { $gt: 0 } }).lean(), const users = await this.client.usersData.find({
rep: {
$gt: 0
}
}).lean(),
usersLeaderboard = users.map((u) => { usersLeaderboard = users.map((u) => {
return { return {
id: u.id, id: u.id,
@ -65,7 +73,9 @@ class Leaderboard extends Command {
table.setHeading("#", message.translate("common:USER"), message.translate("common:POINTS")); table.setHeading("#", message.translate("common:USER"), message.translate("common:POINTS"));
if (usersLeaderboard.length > 20) usersLeaderboard.length = 20; if (usersLeaderboard.length > 20) usersLeaderboard.length = 20;
const newTable = await fetchUsers(usersLeaderboard, table, this.client); const newTable = await fetchUsers(usersLeaderboard, table, this.client);
message.channel.send({ content: `\`\`\`\n${newTable.toString()}\`\`\`` }); message.channel.send({
content: `\`\`\`\n${newTable.toString()}\`\`\``
});
}; };
if (isOnlyOnMobile) message.sendT("economy/leaderboard:MOBILE"); if (isOnlyOnMobile) message.sendT("economy/leaderboard:MOBILE");

View file

@ -61,7 +61,9 @@ class Credits extends Command {
.addField(message.translate("economy/profile:BANK"), `**${memberData.bankSold}** ${message.getNoun(memberData.bankSold, message.translate("misc:NOUNS:CREDIT:1"), message.translate("misc:NOUNS:CREDIT:2"), message.translate("misc:NOUNS:CREDIT:5"))}`, true) .addField(message.translate("economy/profile:BANK"), `**${memberData.bankSold}** ${message.getNoun(memberData.bankSold, message.translate("misc:NOUNS:CREDIT:1"), message.translate("misc:NOUNS:CREDIT:2"), message.translate("misc:NOUNS:CREDIT:5"))}`, true)
.addField(message.translate("economy/profile:GLOBAL"), `**${globalMoney}** ${message.getNoun(globalMoney, message.translate("misc:NOUNS:CREDIT:1"), message.translate("misc:NOUNS:CREDIT:2"), message.translate("misc:NOUNS:CREDIT:5"))}`, true) .addField(message.translate("economy/profile:GLOBAL"), `**${globalMoney}** ${message.getNoun(globalMoney, message.translate("misc:NOUNS:CREDIT:1"), message.translate("misc:NOUNS:CREDIT:2"), message.translate("misc:NOUNS:CREDIT:5"))}`, true)
.setColor(data.config.embed.color) .setColor(data.config.embed.color)
.setFooter({ text: data.config.embed.footer }); .setFooter({
text: data.config.embed.footer
});
message.channel.send({ message.channel.send({
embeds: [embed] embeds: [embed]
}); });

View file

@ -52,13 +52,16 @@ class Profile extends Command {
}); });
const profileEmbed = new Discord.MessageEmbed() const profileEmbed = new Discord.MessageEmbed()
.setAuthor({ name: message.translate("economy/profile:TITLE", { .setAuthor({
username: member.user.tag name: message.translate("economy/profile:TITLE", {
}), iconURL: member.user.displayAvatarURL({ username: member.user.tag
size: 512, }),
dynamic: true, iconURL: member.user.displayAvatarURL({
format: "png" size: 512,
})}) dynamic: true,
format: "png"
})
})
.setImage("attachment://achievements.png") .setImage("attachment://achievements.png")
.addField(message.translate("economy/profile:BIO"), userData.bio ? userData.bio : message.translate("economy/profile:NO_BIO")) .addField(message.translate("economy/profile:BIO"), userData.bio ? userData.bio : message.translate("economy/profile:NO_BIO"))
.addField(message.translate("economy/profile:CASH"), `**${memberData.money}** ${message.getNoun(memberData.money, message.translate("misc:NOUNS:CREDIT:1"), message.translate("misc:NOUNS:CREDIT:2"), message.translate("misc:NOUNS:CREDIT:5"))}`, true) .addField(message.translate("economy/profile:CASH"), `**${memberData.money}** ${message.getNoun(memberData.money, message.translate("misc:NOUNS:CREDIT:1"), message.translate("misc:NOUNS:CREDIT:2"), message.translate("misc:NOUNS:CREDIT:5"))}`, true)
@ -74,10 +77,15 @@ class Profile extends Command {
prefix: data.guild.prefix prefix: data.guild.prefix
})) }))
.setColor(data.config.embed.color) // Sets the color of the embed .setColor(data.config.embed.color) // Sets the color of the embed
.setFooter({ text: data.config.embed.footer }) // Sets the footer of the embed .setFooter({
text: data.config.embed.footer
}) // Sets the footer of the embed
.setTimestamp(); .setTimestamp();
message.channel.send({ embeds: [profileEmbed], files: [userData.getAchievements()] }); // Send the embed in the current channel message.channel.send({
embeds: [profileEmbed],
files: [userData.getAchievements()]
}); // Send the embed in the current channel
} }
}; };

View file

@ -19,7 +19,6 @@ class Rob extends Command {
async run(message, args, data) { async run(message, args, data) {
const member = await this.client.resolveMember(args[0], message.guild); const member = await this.client.resolveMember(args[0], message.guild);
if (!member) return message.error("economy/rob:MISSING_MEMBER"); if (!member) return message.error("economy/rob:MISSING_MEMBER");
if (member.id === message.author.id) return message.error("economy/rob:YOURSELF"); if (member.id === message.author.id) return message.error("economy/rob:YOURSELF");
const memberData = await this.client.findOrCreateMember({ const memberData = await this.client.findOrCreateMember({
@ -28,21 +27,15 @@ class Rob extends Command {
}); });
const isInCooldown = memberData.cooldowns.rob || 0; const isInCooldown = memberData.cooldowns.rob || 0;
if (isInCooldown) { if (isInCooldown) {
if (isInCooldown > Date.now()) return message.error("economy/rob:COOLDOWN", { if (isInCooldown > Date.now()) return message.error("economy/rob:COOLDOWN", { username: member.user.tag });
username: member.user.tag
});
}; };
let amountToRob = args[1]; let amountToRob = args[1];
if (!amountToRob || isNaN(amountToRob) || parseInt(amountToRob, 10) <= 0) return message.error("economy/rob:MISSING_AMOUNT", { if (!amountToRob || isNaN(amountToRob) || parseInt(amountToRob, 10) <= 0) return message.error("economy/rob:MISSING_AMOUNT", { username: member.user.username });
username: member.user.username
});
amountToRob = Math.floor(parseInt(amountToRob, 10)); amountToRob = Math.floor(parseInt(amountToRob, 10));
if (amountToRob > memberData.money) return message.error("economy/rob:NOT_ENOUGH_MEMBER", { if (amountToRob > memberData.money) return message.error("economy/rob:NOT_ENOUGH_MEMBER", { username: member.user.username });
username: member.user.username
});
const potentiallyLose = Math.floor(amountToRob * 1.5); const potentiallyLose = Math.floor(amountToRob * 1.5);
if (potentiallyLose > data.memberData.money) return message.error("economy/rob:NOT_ENOUGH_AUTHOR", { if (potentiallyLose > data.memberData.money) return message.error("economy/rob:NOT_ENOUGH_AUTHOR", {

View file

@ -19,15 +19,9 @@ class Slots extends Command {
async run(message, args, data) { async run(message, args, data) {
const fruits = ["🍎", "🍐", "🍌", "🍇", "🍉", "🍒", "🍓"]; const fruits = ["🍎", "🍐", "🍌", "🍇", "🍉", "🍒", "🍓"];
let i1 = 0, let i1 = 0, j1 = 0, k1 = 0,
j1 = 0, i2 = 1, j2 = 1, k2 = 1,
k1 = 0, i3 = 2, j3 = 2, k3 = 2;
i2 = 1,
j2 = 1,
k2 = 1,
i3 = 2,
j3 = 2,
k3 = 2;
// Gets three random fruits array // Gets three random fruits array
const colonnes = [ const colonnes = [
@ -39,9 +33,7 @@ class Slots extends Command {
// Gets the amount provided // Gets the amount provided
let amount = args[0]; let amount = args[0];
if (!amount || isNaN(amount) || amount < 1) amount = 50; if (!amount || isNaN(amount) || amount < 1) amount = 50;
if (amount > data.memberData.money) return message.error("economy/slots:NOT_ENOUGH", { if (amount > data.memberData.money) return message.error("economy/slots:NOT_ENOUGH", { money: `${amount} ${message.getNoun(amount, message.translate("misc:NOUNS:CREDIT:1"), message.translate("misc:NOUNS:CREDIT:2"), message.translate("misc:NOUNS:CREDIT:5"))}` });
money: `${amount} ${message.getNoun(amount, message.translate("misc:NOUNS:CREDIT:1"), message.translate("misc:NOUNS:CREDIT:2"), message.translate("misc:NOUNS:CREDIT:5"))}`
});
amount = Math.round(amount); amount = Math.round(amount);

View file

@ -28,9 +28,7 @@ class Withdraw extends Command {
amount = parseInt(amount, 10); amount = parseInt(amount, 10);
}; };
if (data.memberData.bankSold < amount) return message.error("economy/withdraw:NOT_ENOUGH", { if (data.memberData.bankSold < amount) return message.error("economy/withdraw:NOT_ENOUGH", { money: `**${amount}** ${message.getNoun(amount, message.translate("misc:NOUNS:CREDIT:1"), message.translate("misc:NOUNS:CREDIT:2"), message.translate("misc:NOUNS:CREDIT:5"))}` });
money: `**${amount}** ${message.getNoun(amount, message.translate("misc:NOUNS:CREDIT:1"), message.translate("misc:NOUNS:CREDIT:2"), message.translate("misc:NOUNS:CREDIT:5"))}`
});
data.memberData.money = data.memberData.money + amount; data.memberData.money = data.memberData.money + amount;
data.memberData.bankSold = data.memberData.bankSold - amount; data.memberData.bankSold = data.memberData.bankSold - amount;

View file

@ -40,11 +40,14 @@ class Work extends Command {
await data.memberData.save(); await data.memberData.save();
const embed = new Discord.MessageEmbed() const embed = new Discord.MessageEmbed()
.setFooter({ text: message.translate("economy/work:AWARD"), iconURL: message.author.displayAvatarURL({ .setFooter({
size: 512, text: message.translate("economy/work:AWARD"),
dynamic: true, iconURL: message.author.displayAvatarURL({
format: "png" size: 512,
})}) dynamic: true,
format: "png"
})
})
.setColor(data.config.embed.color); .setColor(data.config.embed.color);
const award = [ const award = [

View file

@ -22,7 +22,9 @@ class Eightball extends Command {
const answerN = this.client.functions.randomNum(1, 19); const answerN = this.client.functions.randomNum(1, 19);
const answer = message.translate(`fun/8ball:RESPONSE_${answerN + 1}`); const answer = message.translate(`fun/8ball:RESPONSE_${answerN + 1}`);
message.channel.send({ content: answer }); message.channel.send({
content: answer
});
} }
}; };

View file

@ -25,7 +25,9 @@ class Ascii extends Command {
const rendered = await figletAsync(text); const rendered = await figletAsync(text);
message.channel.send({ content: "```" + rendered + "```" }); message.channel.send({
content: "```" + rendered + "```"
});
} }
}; };

View file

@ -29,7 +29,9 @@ class Choice extends Command {
edit: true edit: true
}); });
const result = answers[parseInt(Math.floor(Math.random() * answers.length))]; const result = answers[parseInt(Math.floor(Math.random() * answers.length))];
message.channel.send({ content: "```" + result + "```" }); message.channel.send({
content: "```" + result + "```"
});
}, 1500); }, 1500);
} }
}; };

View file

@ -25,10 +25,14 @@ class Fml extends Command {
const embed = new Discord.MessageEmbed() const embed = new Discord.MessageEmbed()
.setDescription(fml.content) .setDescription(fml.content)
.setFooter({ text: message.translate("fun/fml:FOOTER") }) .setFooter({
text: message.translate("fun/fml:FOOTER")
})
.setColor(data.config.embed.color); .setColor(data.config.embed.color);
message.channel.send({ embeds: [embed] }); message.channel.send({
embeds: [embed]
});
} }
}; };

View file

@ -25,10 +25,14 @@ class Joke extends Command {
const embed = new Discord.MessageEmbed() const embed = new Discord.MessageEmbed()
.setDescription(joke.toDiscordSpoils()) .setDescription(joke.toDiscordSpoils())
.setFooter({ text: message.translate("fun/joke:FOOTER") }) .setFooter({
text: message.translate("fun/joke:FOOTER")
})
.setColor(data.config.embed.color); .setColor(data.config.embed.color);
message.channel.send({embeds: [embed] }); message.channel.send({
embeds: [embed]
});
} }
}; };

View file

@ -20,7 +20,9 @@ class Lmg extends Command {
const question = args.join(" "); const question = args.join(" ");
if (!question) return message.error("fun/lmg:MISSING"); if (!question) return message.error("fun/lmg:MISSING");
const encodedQuestion = question.replace(/[' '_]/g, "+"); const encodedQuestion = question.replace(/[' '_]/g, "+");
await message.channel.send({ content: `https://google.gik-team.com/?q=${encodedQuestion}` }); await message.channel.send({
content: `https://google.gik-team.com/?q=${encodedQuestion}`
});
message.delete().catch(() => {}); message.delete().catch(() => {});
} }
}; };

View file

@ -37,16 +37,22 @@ class Lovecalc extends Command {
const percent = parseInt(string.substr(0, 2), 10); const percent = parseInt(string.substr(0, 2), 10);
const embed = new Discord.MessageEmbed() const embed = new Discord.MessageEmbed()
.setAuthor({ name: `❤️ ${message.translate("fun/lovecalc:DESCRIPTION")}` }) .setAuthor({
name: `❤️ ${message.translate("fun/lovecalc:DESCRIPTION")}`
})
.setDescription(message.translate("fun/lovecalc:CONTENT", { .setDescription(message.translate("fun/lovecalc:CONTENT", {
percent, percent,
firstUsername: firstMember.user.username, firstUsername: firstMember.user.username,
secondUsername: secondMember.user.username secondUsername: secondMember.user.username
})) }))
.setColor(data.config.embed.color) .setColor(data.config.embed.color)
.setFooter({ text: data.config.embed.footer }); .setFooter({
text: data.config.embed.footer
});
message.channel.send({ embeds: [embed] }); message.channel.send({
embeds: [embed]
});
} }
}; };

View file

@ -34,9 +34,13 @@ class Activity extends Command {
.setTitle("Awkword") .setTitle("Awkword")
.setColor(data.config.embed.color) .setColor(data.config.embed.color)
.setDescription(`**[${message.translate("misc:CLICK_HERE", { activity: "Awkword", channel: voice.name })}](${invite.code})**`) .setDescription(`**[${message.translate("misc:CLICK_HERE", { activity: "Awkword", channel: voice.name })}](${invite.code})**`)
.setFooter({ text: message.translate("general/activity:FOOTER") }) .setFooter({
text: message.translate("general/activity:FOOTER")
})
.setTimestamp() .setTimestamp()
return message.channel.send({ embeds: [embed] }); return message.channel.send({
embeds: [embed]
});
}); });
break; break;
@ -46,9 +50,13 @@ class Activity extends Command {
.setTitle("Betrayal.io") .setTitle("Betrayal.io")
.setColor(data.config.embed.color) .setColor(data.config.embed.color)
.setDescription(`**[${message.translate("misc:CLICK_HERE", { activity: "Betrayal.io", channel: voice.name })}](${invite.code})**`) .setDescription(`**[${message.translate("misc:CLICK_HERE", { activity: "Betrayal.io", channel: voice.name })}](${invite.code})**`)
.setFooter({ text: message.translate("general/activity:FOOTER") }) .setFooter({
text: message.translate("general/activity:FOOTER")
})
.setTimestamp() .setTimestamp()
return message.channel.send({ embeds: [embed] }); return message.channel.send({
embeds: [embed]
});
}); });
break; break;
@ -58,9 +66,13 @@ class Activity extends Command {
.setTitle("Checkers In The Park") .setTitle("Checkers In The Park")
.setColor(data.config.embed.color) .setColor(data.config.embed.color)
.setDescription(`**[${message.translate("misc:CLICK_HERE", { activity: "Checkers In The Park", channel: voice.name })}](${invite.code})**`) .setDescription(`**[${message.translate("misc:CLICK_HERE", { activity: "Checkers In The Park", channel: voice.name })}](${invite.code})**`)
.setFooter({ text: message.translate("general/activity:FOOTER") }) .setFooter({
text: message.translate("general/activity:FOOTER")
})
.setTimestamp() .setTimestamp()
return message.channel.send({ embeds: [embed] }); return message.channel.send({
embeds: [embed]
});
}); });
break; break;
@ -70,9 +82,13 @@ class Activity extends Command {
.setTitle("Chess In The Park") .setTitle("Chess In The Park")
.setColor(data.config.embed.color) .setColor(data.config.embed.color)
.setDescription(`**[${message.translate("misc:CLICK_HERE", { activity: "Chess In The Park", channel: voice.name })}](${invite.code})**`) .setDescription(`**[${message.translate("misc:CLICK_HERE", { activity: "Chess In The Park", channel: voice.name })}](${invite.code})**`)
.setFooter({ text: message.translate("general/activity:FOOTER") }) .setFooter({
text: message.translate("general/activity:FOOTER")
})
.setTimestamp() .setTimestamp()
return message.channel.send({ embeds: [embed] }); return message.channel.send({
embeds: [embed]
});
}); });
break; break;
@ -82,9 +98,13 @@ class Activity extends Command {
.setTitle("Doodle Crew") .setTitle("Doodle Crew")
.setColor(data.config.embed.color) .setColor(data.config.embed.color)
.setDescription(`**[${message.translate("misc:CLICK_HERE", { activity: "Doodle Crew", channel: voice.name })}](${invite.code})**`) .setDescription(`**[${message.translate("misc:CLICK_HERE", { activity: "Doodle Crew", channel: voice.name })}](${invite.code})**`)
.setFooter({ text: message.translate("general/activity:FOOTER") }) .setFooter({
text: message.translate("general/activity:FOOTER")
})
.setTimestamp() .setTimestamp()
return message.channel.send({ embeds: [embed] }); return message.channel.send({
embeds: [embed]
});
}); });
break; break;
@ -94,9 +114,13 @@ class Activity extends Command {
.setTitle("Fishington.io") .setTitle("Fishington.io")
.setColor(data.config.embed.color) .setColor(data.config.embed.color)
.setDescription(`**[${message.translate("misc:CLICK_HERE", { activity: "Fishington.io", channel: voice.name })}](${invite.code})**`) .setDescription(`**[${message.translate("misc:CLICK_HERE", { activity: "Fishington.io", channel: voice.name })}](${invite.code})**`)
.setFooter({ text: message.translate("general/activity:FOOTER") }) .setFooter({
text: message.translate("general/activity:FOOTER")
})
.setTimestamp() .setTimestamp()
return message.channel.send({ embeds: [embed] }); return message.channel.send({
embeds: [embed]
});
}); });
break; break;
@ -106,9 +130,13 @@ class Activity extends Command {
.setTitle("Letter Tile") .setTitle("Letter Tile")
.setColor(data.config.embed.color) .setColor(data.config.embed.color)
.setDescription(`**[${message.translate("misc:CLICK_HERE", { activity: "Letter Tile", channel: voice.name })}](${invite.code})**`) .setDescription(`**[${message.translate("misc:CLICK_HERE", { activity: "Letter Tile", channel: voice.name })}](${invite.code})**`)
.setFooter({ text: message.translate("general/activity:FOOTER") }) .setFooter({
text: message.translate("general/activity:FOOTER")
})
.setTimestamp() .setTimestamp()
return message.channel.send({ embeds: [embed] }); return message.channel.send({
embeds: [embed]
});
}); });
break; break;
@ -118,9 +146,13 @@ class Activity extends Command {
.setTitle("Poker Night") .setTitle("Poker Night")
.setColor(data.config.embed.color) .setColor(data.config.embed.color)
.setDescription(`**[${message.translate("misc:CLICK_HERE", { activity: "Poker Night", channel: voice.name })}](${invite.code})**`) .setDescription(`**[${message.translate("misc:CLICK_HERE", { activity: "Poker Night", channel: voice.name })}](${invite.code})**`)
.setFooter({ text: message.translate("general/activity:FOOTER") }) .setFooter({
text: message.translate("general/activity:FOOTER")
})
.setTimestamp() .setTimestamp()
return message.channel.send({ embeds: [embed] }); return message.channel.send({
embeds: [embed]
});
}); });
break; break;
@ -130,9 +162,13 @@ class Activity extends Command {
.setTitle("Spell Cast") .setTitle("Spell Cast")
.setColor(data.config.embed.color) .setColor(data.config.embed.color)
.setDescription(`**[${message.translate("misc:CLICK_HERE", { activity: "Spell Cast", channel: voice.name })}](${invite.code})**`) .setDescription(`**[${message.translate("misc:CLICK_HERE", { activity: "Spell Cast", channel: voice.name })}](${invite.code})**`)
.setFooter({ text: message.translate("general/activity:FOOTER") }) .setFooter({
text: message.translate("general/activity:FOOTER")
})
.setTimestamp() .setTimestamp()
return message.channel.send({ embeds: [embed] }); return message.channel.send({
embeds: [embed]
});
}); });
break; break;
@ -142,9 +178,13 @@ class Activity extends Command {
.setTitle("Words Snack") .setTitle("Words Snack")
.setColor(data.config.embed.color) .setColor(data.config.embed.color)
.setDescription(`**[${message.translate("misc:CLICK_HERE", { activity: "Words Snack", channel: voice.name })}](${invite.code})**`) .setDescription(`**[${message.translate("misc:CLICK_HERE", { activity: "Words Snack", channel: voice.name })}](${invite.code})**`)
.setFooter({ text: message.translate("general/activity:FOOTER") }) .setFooter({
text: message.translate("general/activity:FOOTER")
})
.setTimestamp() .setTimestamp()
return message.channel.send({ embeds: [embed] }); return message.channel.send({
embeds: [embed]
});
}); });
break; break;
@ -154,9 +194,13 @@ class Activity extends Command {
.setTitle("Puttparty") .setTitle("Puttparty")
.setColor(data.config.embed.color) .setColor(data.config.embed.color)
.setDescription(`**[${message.translate("misc:CLICK_HERE", { activity: "Puttparty", channel: voice.name })}](${invite.code})**`) .setDescription(`**[${message.translate("misc:CLICK_HERE", { activity: "Puttparty", channel: voice.name })}](${invite.code})**`)
.setFooter({ text: message.translate("general/activity:FOOTER") }) .setFooter({
text: message.translate("general/activity:FOOTER")
})
.setTimestamp() .setTimestamp()
return message.channel.send({ embeds: [embed] }); return message.channel.send({
embeds: [embed]
});
}); });
break; break;
@ -166,9 +210,13 @@ class Activity extends Command {
.setTitle("Youtube Together") .setTitle("Youtube Together")
.setColor(data.config.embed.color) .setColor(data.config.embed.color)
.setDescription(`**[${message.translate("misc:CLICK_HERE", { activity: "Youtube Together", channel: voice.name })}](${invite.code})**`) .setDescription(`**[${message.translate("misc:CLICK_HERE", { activity: "Youtube Together", channel: voice.name })}](${invite.code})**`)
.setFooter({ text: message.translate("general/activity:FOOTER") }) .setFooter({
text: message.translate("general/activity:FOOTER")
})
.setTimestamp() .setTimestamp()
return message.channel.send({ embeds: [embed] }); return message.channel.send({
embeds: [embed]
});
}); });
break; break;
@ -177,9 +225,13 @@ class Activity extends Command {
.setTitle(message.translate("general/activity:TITLE")) .setTitle(message.translate("general/activity:TITLE"))
.setDescription(activities.join("\n")) .setDescription(activities.join("\n"))
.setColor(data.config.embed.color) .setColor(data.config.embed.color)
.setFooter({ text: message.translate("general/activity:FOOTER") }) .setFooter({
text: message.translate("general/activity:FOOTER")
})
.setTimestamp() .setTimestamp()
message.channel.send({ embeds: [embed] }); message.channel.send({
embeds: [embed]
});
break; break;
}; };
} }

View file

@ -67,8 +67,13 @@ class Fortnite extends Command {
})) }))
.setImage("attachment://fortnite-stats-image.png") .setImage("attachment://fortnite-stats-image.png")
.setColor(data.config.embed.color) .setColor(data.config.embed.color)
.setFooter({ text: data.config.embed.footer }); .setFooter({
message.channel.send({ embeds: [embed], files: [attachment] }); text: data.config.embed.footer
});
message.channel.send({
embeds: [embed],
files: [attachment]
});
m.delete(); m.delete();
} }
}; };

View file

@ -41,17 +41,25 @@ class Fortniteshop extends Command {
const attachment = new Discord.MessageAttachment(image, "shop.png"); const attachment = new Discord.MessageAttachment(image, "shop.png");
const embed = new Discord.MessageEmbed() const embed = new Discord.MessageEmbed()
.setAuthor({ name: message.translate("general/fortniteshop:HEADER", { .setAuthor({
date: message.printDate(new Date(Date.now())) name: message.translate("general/fortniteshop:HEADER", {
}), iconURL: this.client.user.displayAvatarURL({ date: message.printDate(new Date(Date.now()))
size: 512, }),
dynamic: true, iconURL: this.client.user.displayAvatarURL({
format: "png" size: 512,
})}) dynamic: true,
format: "png"
})
})
.setImage("attachment://shop.png") .setImage("attachment://shop.png")
.setColor(data.config.embed.color) .setColor(data.config.embed.color)
.setFooter({ text: data.config.embed.footer }); .setFooter({
await message.channel.send({ embeds: [embed], files: [attachment] }); text: data.config.embed.footer
});
await message.channel.send({
embeds: [embed],
files: [attachment]
});
await m.delete(); await m.delete();
return; return;
} }

View file

@ -23,12 +23,14 @@ class Github extends Command {
const json = await res.json(); const json = await res.json();
const embed = new Discord.MessageEmbed() const embed = new Discord.MessageEmbed()
.setAuthor({ name: this.client.user.tag, iconURL: this.client.user.displayAvatarURL({ .setAuthor({
size: 512, name: this.client.user.tag,
dynamic: true, iconURL: this.client.user.displayAvatarURL({
format: "png" size: 512,
dynamic: true,
format: "png"
})
}) })
})
.setDescription(`[${message.translate("general/github:CLICK_HERE")}](${json.html_url})`) .setDescription(`[${message.translate("general/github:CLICK_HERE")}](${json.html_url})`)
.addField("Название", json.name, true) .addField("Название", json.name, true)
.addField("Звёзды", json.stargazers_count, true) .addField("Звёзды", json.stargazers_count, true)
@ -37,9 +39,13 @@ class Github extends Command {
.addField(message.translate("general/github:OWNER"), `[${json.owner.login}](${json.owner.html_url})`) .addField(message.translate("general/github:OWNER"), `[${json.owner.login}](${json.owner.html_url})`)
.setImage(json.owner.avatar_url) .setImage(json.owner.avatar_url)
.setColor(data.config.embed.color) .setColor(data.config.embed.color)
.setFooter({ text: data.config.embed.footer }); .setFooter({
text: data.config.embed.footer
});
message.channel.send({ embeds: [embed] }); message.channel.send({
embeds: [embed]
});
} }
}; };

View file

@ -37,10 +37,14 @@ class Hastebin extends Command {
const url = `https://hastebin.com/${json.key}.js`; const url = `https://hastebin.com/${json.key}.js`;
const embed = new Discord.MessageEmbed() const embed = new Discord.MessageEmbed()
.setAuthor({ name: message.translate("general/hastebin:SUCCESS") }) .setAuthor({
name: message.translate("general/hastebin:SUCCESS")
})
.setDescription(url) .setDescription(url)
.setColor(data.config.embed.color); .setColor(data.config.embed.color);
message.channel.send({ embeds: [embed] }); message.channel.send({
embeds: [embed]
});
} catch (e) { } catch (e) {
message.error("misc:ERR_OCCURRED"); message.error("misc:ERR_OCCURRED");
}; };

View file

@ -41,16 +41,24 @@ class Help extends Command {
}); });
const groupEmbed = new Discord.MessageEmbed() const groupEmbed = new Discord.MessageEmbed()
.setAuthor({ name: message.translate("general/help:CMD_TITLE", { cmd: cmd.help.name }) }) .setAuthor({
name: message.translate("general/help:CMD_TITLE", {
cmd: cmd.help.name
})
})
.addField(message.translate("general/help:FIELD_DESCRIPTION"), description) .addField(message.translate("general/help:FIELD_DESCRIPTION"), description)
.addField(message.translate("general/help:FIELD_USAGE"), usage) .addField(message.translate("general/help:FIELD_USAGE"), usage)
.addField(message.translate("general/help:FIELD_EXAMPLES"), examples) .addField(message.translate("general/help:FIELD_EXAMPLES"), examples)
.addField(message.translate("general/help:FIELD_ALIASES"), cmd.help.aliases.length > 0 ? cmd.help.aliases.map(a => "`" + a + "`").join("\n") : message.translate("general/help:NO_ALIAS")) .addField(message.translate("general/help:FIELD_ALIASES"), cmd.help.aliases.length > 0 ? cmd.help.aliases.map(a => "`" + a + "`").join("\n") : message.translate("general/help:NO_ALIAS"))
.addField(message.translate("general/help:FIELD_PERMISSIONS"), cmd.conf.memberPermissions.length > 0 ? cmd.conf.memberPermissions.map((p) => `\`${p}\``).join("\n") : message.translate("general/help:NO_REQUIRED_PERMISSION")) .addField(message.translate("general/help:FIELD_PERMISSIONS"), cmd.conf.memberPermissions.length > 0 ? cmd.conf.memberPermissions.map((p) => `\`${p}\``).join("\n") : message.translate("general/help:NO_REQUIRED_PERMISSION"))
.setColor(this.client.config.embed.color) .setColor(this.client.config.embed.color)
.setFooter({ text: this.client.config.embed.footer }); .setFooter({
text: this.client.config.embed.footer
});
return message.channel.send({ embeds: [groupEmbed] }); return message.channel.send({
embeds: [groupEmbed]
});
}; };
const categories = []; const categories = [];
@ -70,11 +78,14 @@ class Help extends Command {
prefix: message.guild ? data.guild.prefix : "" prefix: message.guild ? data.guild.prefix : ""
})) }))
.setColor(data.config.embed.color) .setColor(data.config.embed.color)
.setFooter({ text: data.config.embed.footer }); .setFooter({
text: data.config.embed.footer
});
categories.sort().forEach((cat) => { categories.sort().forEach((cat) => {
const tCommands = commands.filter((cmd) => cmd.help.category === cat); const tCommands = commands.filter((cmd) => cmd.help.category === cat);
embed.addField(`${emojis.categories[cat.toLowerCase()]} ${cat} - (${tCommands.size})`, `${tCommands.map((cmd) => `${cmd.help.name}`).join(", ")}`); embed.addField(`${emojis.categories[cat.toLowerCase()]} ${cat} - (${tCommands.size})`, `${tCommands.map((cmd) => `${cmd.help.name}`).join(", ")}`);
}); });
if (message.guild) { if (message.guild) {
if (data.guild.customCommands.length > 0) embed.addField(`${emojis.categories.custom} ${message.guild.name} | ${message.translate("general/help:CUSTOM_COMMANDS")} - (${data.guild.customCommands.length})`, data.guild.customCommands.map((cmd) => `\`${cmd.name}\``).join(", ")); if (data.guild.customCommands.length > 0) embed.addField(`${emojis.categories.custom} ${message.guild.name} | ${message.translate("general/help:CUSTOM_COMMANDS")} - (${data.guild.customCommands.length})`, data.guild.customCommands.map((cmd) => `\`${cmd.name}\``).join(", "));
}; };
@ -85,14 +96,20 @@ class Help extends Command {
donateLink: "https://qiwi.com/n/JONNYBRO/", donateLink: "https://qiwi.com/n/JONNYBRO/",
owner: this.client.config.owner.id owner: this.client.config.owner.id
})); }));
embed.setAuthor({ name: message.translate("general/help:TITLE", { embed.setAuthor({
name: this.client.user.username name: message.translate("general/help:TITLE", {
}), iconURL: this.client.user.displayAvatarURL({ name: this.client.user.username
size: 512, }),
dynamic: true, iconURL: this.client.user.displayAvatarURL({
format: "png" size: 512,
})}); dynamic: true,
return message.channel.send({ embeds: [embed] }); format: "png"
})
});
return message.channel.send({
embeds: [embed]
});
} }
}; };

View file

@ -48,8 +48,12 @@ class Invitations extends Command {
const embed = new Discord.MessageEmbed() const embed = new Discord.MessageEmbed()
.setColor(data.config.embed.color) .setColor(data.config.embed.color)
.setFooter({ text: data.config.embed.footer }) .setFooter({
.setAuthor({ name: message.translate("general/invitations:TRACKER") }) text: data.config.embed.footer
})
.setAuthor({
name: message.translate("general/invitations:TRACKER")
})
.setDescription(message.translate("general/invitations:TITLE", { .setDescription(message.translate("general/invitations:TITLE", {
member: member.user.tag, member: member.user.tag,
guild: message.guild.name guild: message.guild.name
@ -59,7 +63,9 @@ class Invitations extends Command {
})) }))
.addField(message.translate("general/invitations:FIELD_CODES"), content); .addField(message.translate("general/invitations:FIELD_CODES"), content);
message.channel.send({ embeds: [embed] }); message.channel.send({
embeds: [embed]
});
} }
}; };

View file

@ -18,14 +18,21 @@ class Invite extends Command {
} }
async run(message, args, data) { async run(message, args, data) {
const inviteLink = this.client.generateInvite({ scopes: ["bot"] , permissions: [Discord.Permissions.FLAGS.ADMINISTRATOR] }); const inviteLink = this.client.generateInvite({
scopes: ["bot"],
permissions: [Discord.Permissions.FLAGS.ADMINISTRATOR]
});
const voteURL = `https://discordbots.org/bot/${this.client.user.id}/vote`; const voteURL = `https://discordbots.org/bot/${this.client.user.id}/vote`;
const supportURL = await this.client.functions.supportLink(this.client); const supportURL = await this.client.functions.supportLink(this.client);
if (args[0] && args[0] === "copy") return message.channel.send({ content: inviteLink }); if (args[0] && args[0] === "copy") return message.channel.send({
content: inviteLink
});
const embed = new Discord.MessageEmbed() const embed = new Discord.MessageEmbed()
.setAuthor({ name: message.translate("general/invite:LINKS") }) .setAuthor({
name: message.translate("general/invite:LINKS")
})
.setDescription(message.translate("general/invite:TIP", { .setDescription(message.translate("general/invite:TIP", {
prefix: data.guild.prefix || "" prefix: data.guild.prefix || ""
})) }))
@ -33,9 +40,13 @@ class Invite extends Command {
.addField(message.translate("general/invite:VOTE"), voteURL) .addField(message.translate("general/invite:VOTE"), voteURL)
.addField(message.translate("general/invite:SUPPORT"), supportURL) .addField(message.translate("general/invite:SUPPORT"), supportURL)
.setColor(data.config.embed.color) .setColor(data.config.embed.color)
.setFooter({ text: data.config.embed.footer }); .setFooter({
text: data.config.embed.footer
});
message.channel.send({ embeds: [embed] }); message.channel.send({
embeds: [embed]
});
} }
}; };

View file

@ -66,10 +66,11 @@ class Minecraft extends Command {
const imgAttachment = new Discord.MessageAttachment(await imgRes.buffer(), "success.png"); const imgAttachment = new Discord.MessageAttachment(await imgRes.buffer(), "success.png");
const mcEmbed = new Discord.MessageEmbed() const mcEmbed = new Discord.MessageEmbed()
.setAuthor({ name: message.translate("general/minecraft:FIELD_NAME", { .setAuthor({
ip: json.name name: message.translate("general/minecraft:FIELD_NAME", {
ip: json.name
})
}) })
})
.addField(message.translate("general/minecraft:FIELD_VERSION"), json.raw.vanilla.raw.version.name) .addField(message.translate("general/minecraft:FIELD_VERSION"), json.raw.vanilla.raw.version.name)
.addField(message.translate("general/minecraft:FIELD_CONNECTED"), message.translate("general/minecraft:PLAYERS", { .addField(message.translate("general/minecraft:FIELD_CONNECTED"), message.translate("general/minecraft:PLAYERS", {
count: (json.raw.players ? json.raw.players.online : json.players.length) count: (json.raw.players ? json.raw.players.online : json.players.length)
@ -81,9 +82,15 @@ class Minecraft extends Command {
.addField(message.translate("general/minecraft:FIELD_IP"), json.connect) .addField(message.translate("general/minecraft:FIELD_IP"), json.connect)
.setColor(data.config.embed.color) .setColor(data.config.embed.color)
.setThumbnail(favicon) .setThumbnail(favicon)
.setFooter({ text: data.config.embed.footer }); .setFooter({
text: data.config.embed.footer
});
m.edit({ content: null, embeds: [mcEmbed], files: [imgAttachment] }); m.edit({
content: null,
embeds: [mcEmbed],
files: [imgAttachment]
});
} }
}; };

View file

@ -37,7 +37,9 @@ class Permissions extends Command {
}; };
}); });
text += `\n${total.allowed} ✅ | ${total.denied}` + "\n```"; text += `\n${total.allowed} ✅ | ${total.denied}` + "\n```";
message.channel.send({ content: text }); message.channel.send({
content: text
});
} }
}; };

View file

@ -20,14 +20,19 @@ class Quote extends Command {
async run(message, args, data) { async run(message, args, data) {
function embed(m) { function embed(m) {
const embed = new Discord.MessageEmbed() const embed = new Discord.MessageEmbed()
.setAuthor({ name: m.author.tag, iconURL: m.author.displayAvatarURL({ .setAuthor({
size: 512, name: m.author.tag,
dynamic: true, iconURL: m.author.displayAvatarURL({
format: "png" size: 512,
})}) dynamic: true,
format: "png"
})
})
.setDescription(m.content) .setDescription(m.content)
.setColor(m.member ? m.member.roles.highest ? m.member.roles.highest.color : data.config.embed.color : data.config.embed.color) .setColor(m.member ? m.member.roles.highest ? m.member.roles.highest.color : data.config.embed.color : data.config.embed.color)
.setFooter({ text: m.guild.name + " | #" + m.channel.name }) .setFooter({
text: m.guild.name + " | #" + m.channel.name
})
.setTimestamp(m.createdTimestamp); .setTimestamp(m.createdTimestamp);
if (m.attachments.size > 0) embed.setImage(m.attachments.first().url); if (m.attachments.size > 0) embed.setImage(m.attachments.first().url);
return embed; return embed;
@ -35,7 +40,9 @@ class Quote extends Command {
const msgID = args[0]; const msgID = args[0];
if (isNaN(msgID)) { if (isNaN(msgID)) {
message.author.send({ content: message.translate("general/quote:MISSING_ID") }).then(() => { message.author.send({
content: message.translate("general/quote:MISSING_ID")
}).then(() => {
message.delete(); message.delete();
}).catch(() => { }).catch(() => {
message.error("misc:CANNOT_DM"); message.error("misc:CANNOT_DM");
@ -66,7 +73,9 @@ class Quote extends Command {
return; return;
}).then((msg) => { }).then((msg) => {
message.delete(); message.delete();
message.channel.send({ embeds: [embed(msg)] }); message.channel.send({
embeds: [embed(msg)]
});
}); });
} else { } else {
channel.messages.fetch(msgID).catch(() => { channel.messages.fetch(msgID).catch(() => {
@ -78,7 +87,9 @@ class Quote extends Command {
return; return;
}).then((msg) => { }).then((msg) => {
message.delete(); message.delete();
message.channel.send({ embeds: [embed(msg)] }); message.channel.send({
embeds: [embed(msg)]
});
}); });
}; };
} }

View file

@ -29,24 +29,31 @@ class Report extends Command {
if (!rep) return message.error("general/report:MISSING_REASON"); if (!rep) return message.error("general/report:MISSING_REASON");
const embed = new Discord.MessageEmbed() const embed = new Discord.MessageEmbed()
.setAuthor({ name: message.translate("general/report:TITLE", { .setAuthor({
user: member.user.tag name: message.translate("general/report:TITLE", {
}), iconURL: message.author.displayAvatarURL({ user: member.user.tag
size: 512, }),
dynamic: true, iconURL: message.author.displayAvatarURL({
format: "png" size: 512,
})}) dynamic: true,
format: "png"
})
})
.addField(message.translate("common:AUTHOR"), message.author.tag, true) .addField(message.translate("common:AUTHOR"), message.author.tag, true)
.addField(message.translate("common:DATE"), message.printDate(new Date(Date.now())), true) .addField(message.translate("common:DATE"), message.printDate(new Date(Date.now())), true)
.addField(message.translate("common:REASON"), rep, true) .addField(message.translate("common:REASON"), rep, true)
.addField(message.translate("common:USER"), `\`${member.user.tag}\` (${member.user.toString()})`, true) .addField(message.translate("common:USER"), `\`${member.user.tag}\` (${member.user.toString()})`, true)
.setColor(data.config.embed.color) .setColor(data.config.embed.color)
.setFooter({ text: data.config.embed.footer }); .setFooter({
text: data.config.embed.footer
});
const success = Discord.Util.parseEmoji(this.client.customEmojis.success).id; const success = Discord.Util.parseEmoji(this.client.customEmojis.success).id;
const error = Discord.Util.parseEmoji(this.client.customEmojis.error).id; const error = Discord.Util.parseEmoji(this.client.customEmojis.error).id;
repChannel.send({ embeds: [embed] }).then(async (m) => { repChannel.send({
embeds: [embed]
}).then(async (m) => {
await m.react(success); await m.react(success);
await m.react(error); await m.react(error);
}); });

View file

@ -31,9 +31,12 @@ class Serverinfo extends Command {
await guild.members.fetch(); await guild.members.fetch();
const embed = new Discord.MessageEmbed() const embed = new Discord.MessageEmbed()
.setAuthor({ name: guild.name, iconURL: guild.iconURL({ .setAuthor({
dynamic: true name: guild.name,
})}) iconURL: guild.iconURL({
dynamic: true
})
})
.setThumbnail(guild.iconURL({ .setThumbnail(guild.iconURL({
dynamic: true dynamic: true
})) }))
@ -53,9 +56,13 @@ class Serverinfo extends Command {
"\n" + `${guild.channels.cache.filter(c => c.type === "GUILD_CATEGORY").size} ${message.getNoun(guild.channels.cache.filter(c => c.type === "GUILD_CATEGORY").size, message.translate("misc:NOUNS:CATEGORY:1"), message.translate("misc:NOUNS:CATEGORY:2"), message.translate("misc:NOUNS:CATEGORY:5"))}`, true "\n" + `${guild.channels.cache.filter(c => c.type === "GUILD_CATEGORY").size} ${message.getNoun(guild.channels.cache.filter(c => c.type === "GUILD_CATEGORY").size, message.translate("misc:NOUNS:CATEGORY:1"), message.translate("misc:NOUNS:CATEGORY:2"), message.translate("misc:NOUNS:CATEGORY:5"))}`, true
) )
.setColor(data.config.embed.color) .setColor(data.config.embed.color)
.setFooter({ text: data.config.embed.footer }); .setFooter({
text: data.config.embed.footer
});
message.channel.send({ embeds: [embed] }); message.channel.send({
embeds: [embed]
});
} }
}; };

View file

@ -29,9 +29,13 @@ class ShortURL extends Command {
const embed = new Discord.MessageEmbed() const embed = new Discord.MessageEmbed()
.setColor(data.config.embed.color) .setColor(data.config.embed.color)
.setFooter({ text: data.config.embed.footer }) .setFooter({
text: data.config.embed.footer
})
.setDescription(body); .setDescription(body);
message.channel.send({ embeds: [embed] }); message.channel.send({
embeds: [embed]
});
} }
}; };

View file

@ -30,7 +30,9 @@ class Someone extends Command {
format: "png" format: "png"
})) }))
.setColor(data.config.embed.color); .setColor(data.config.embed.color);
message.channel.send({ embeds: [embed] }); message.channel.send({
embeds: [embed]
});
} }
}; };

View file

@ -22,14 +22,20 @@ class Staff extends Command {
const administrators = message.guild.members.cache.filter((m) => m.permissions.has(Discord.Permissions.FLAGS.ADMINISTRATOR) && !m.user.bot); const administrators = message.guild.members.cache.filter((m) => m.permissions.has(Discord.Permissions.FLAGS.ADMINISTRATOR) && !m.user.bot);
const moderators = message.guild.members.cache.filter((m) => !administrators.has(m.id) && m.permissions.has(Discord.Permissions.FLAGS.MANAGE_MESSAGES) && !m.user.bot); const moderators = message.guild.members.cache.filter((m) => !administrators.has(m.id) && m.permissions.has(Discord.Permissions.FLAGS.MANAGE_MESSAGES) && !m.user.bot);
const embed = new Discord.MessageEmbed() const embed = new Discord.MessageEmbed()
.setAuthor({ name: message.translate("general/staff:TITLE", { .setAuthor({
guild: message.guild.name name: message.translate("general/staff:TITLE", {
})}) guild: message.guild.name
})
})
.addField(message.translate("general/staff:ADMINS"), (administrators.size > 0 ? administrators.map((a) => `${this.client.customEmojis.status[a.presence.status]} | <@${a.user.id}>`).join("\n") : message.translate("general/staff:NO_ADMINS"))) .addField(message.translate("general/staff:ADMINS"), (administrators.size > 0 ? administrators.map((a) => `${this.client.customEmojis.status[a.presence.status]} | <@${a.user.id}>`).join("\n") : message.translate("general/staff:NO_ADMINS")))
.addField(message.translate("general/staff:MODS"), (moderators.size > 0 ? moderators.map((m) => `${this.client.customEmojis.status[m.presence.status]} | <@${m.user.id}>`).join("\n") : message.translate("general/staff:NO_MODS"))) .addField(message.translate("general/staff:MODS"), (moderators.size > 0 ? moderators.map((m) => `${this.client.customEmojis.status[m.presence.status]} | <@${m.user.id}>`).join("\n") : message.translate("general/staff:NO_MODS")))
.setColor(data.config.embed.color) .setColor(data.config.embed.color)
.setFooter({ text: data.config.embed.footer }); .setFooter({
message.channel.send({ embeds: [embed] }); text: data.config.embed.footer
});
message.channel.send({
embeds: [embed]
});
} }
}; };

View file

@ -20,8 +20,12 @@ class Stats extends Command {
async run(message, args, data) { async run(message, args, data) {
const statsEmbed = new Discord.MessageEmbed() const statsEmbed = new Discord.MessageEmbed()
.setColor(data.config.embed.color) .setColor(data.config.embed.color)
.setFooter({ text: data.config.embed.footer }) .setFooter({
.setAuthor({ name: message.translate("common:STATS") }) text: data.config.embed.footer
})
.setAuthor({
name: message.translate("common:STATS")
})
.setDescription(message.translate("general/stats:MADE")) .setDescription(message.translate("general/stats:MADE"))
.addField(this.client.customEmojis.stats + " " + message.translate("general/stats:COUNTS_TITLE"), message.translate("general/stats:COUNTS_CONTENT", { .addField(this.client.customEmojis.stats + " " + message.translate("general/stats:COUNTS_TITLE"), message.translate("general/stats:COUNTS_CONTENT", {
servers: this.client.guilds.cache.size, servers: this.client.guilds.cache.size,
@ -46,7 +50,9 @@ class Stats extends Command {
donateLink: "https://qiwi.com/n/JONNYBRO/", donateLink: "https://qiwi.com/n/JONNYBRO/",
owner: this.client.config.owner.id owner: this.client.config.owner.id
})); }));
message.channel.send({ embeds: [statsEmbed] }); message.channel.send({
embeds: [statsEmbed]
});
} }
}; };

View file

@ -25,23 +25,30 @@ class Suggest extends Command {
if (!sugg) return message.error("general/suggest:MISSING_CONTENT"); if (!sugg) return message.error("general/suggest:MISSING_CONTENT");
const embed = new Discord.MessageEmbed() const embed = new Discord.MessageEmbed()
.setAuthor({ name: message.translate("general/suggest:TITLE", { .setAuthor({
user: message.author.username name: message.translate("general/suggest:TITLE", {
}), iconURL: message.author.displayAvatarURL({ user: message.author.username
size: 512, }),
dynamic: true, iconURL: message.author.displayAvatarURL({
format: "png" size: 512,
})}) dynamic: true,
format: "png"
})
})
.addField(message.translate("common:AUTHOR"), `\`${message.author.username}#${message.author.discriminator}\``, true) .addField(message.translate("common:AUTHOR"), `\`${message.author.username}#${message.author.discriminator}\``, true)
.addField(message.translate("common:DATE"), message.printDate(new Date(Date.now())), true) .addField(message.translate("common:DATE"), message.printDate(new Date(Date.now())), true)
.addField(message.translate("common:CONTENT"), sugg) .addField(message.translate("common:CONTENT"), sugg)
.setColor(data.config.embed.color) .setColor(data.config.embed.color)
.setFooter({ text: data.config.embed.footer }); .setFooter({
text: data.config.embed.footer
});
const success = Discord.Util.parseEmoji(this.client.customEmojis.success).id; const success = Discord.Util.parseEmoji(this.client.customEmojis.success).id;
const error = Discord.Util.parseEmoji(this.client.customEmojis.error).id; const error = Discord.Util.parseEmoji(this.client.customEmojis.error).id;
suggChannel.send({ embeds: [embed] }).then(async (m) => { suggChannel.send({
embeds: [embed]
}).then(async (m) => {
await m.react(success); await m.react(success);
await m.react(error); await m.react(error);
}); });

View file

@ -44,20 +44,23 @@ class Translate extends Command {
if (!langs.includes(language)) return pWait.error("general/translate:INVALID_LANGUAGE", { prefix: data.guild.prefix, search: language }, { edit: true }); if (!langs.includes(language)) return pWait.error("general/translate:INVALID_LANGUAGE", { prefix: data.guild.prefix, search: language }, { edit: true });
const translated = await translate(toTranslate, { const translated = await translate(toTranslate, { to: language });
to: language
});
const resEmbed = new Discord.MessageEmbed() const resEmbed = new Discord.MessageEmbed()
.setAuthor({ name: "Переводчик", iconURL: this.client.user.displayAvatarURL({ .setAuthor({
size: 512, name: "Переводчик",
dynamic: true, iconURL: this.client.user.displayAvatarURL({
format: "png" size: 512,
})}) dynamic: true,
format: "png"
})
})
.addField(translated.from.language.iso, "```" + toTranslate + "```") .addField(translated.from.language.iso, "```" + toTranslate + "```")
.addField(language, "```" + translated.text + "```") .addField(language, "```" + translated.text + "```")
.setColor(data.config.embed.color) .setColor(data.config.embed.color)
.setFooter({ text: data.config.embed.footer }); .setFooter({
text: data.config.embed.footer
});
return pWait.edit({ return pWait.edit({
content: null, content: null,

View file

@ -41,11 +41,14 @@ class Userinfo extends Command {
if (message.guild) member = await message.guild.members.fetch(user).catch(() => {}); if (message.guild) member = await message.guild.members.fetch(user).catch(() => {});
const embed = new Discord.MessageEmbed() const embed = new Discord.MessageEmbed()
.setAuthor({ name: user.tag, iconURL: user.displayAvatarURL({ .setAuthor({
size: 512, name: user.tag,
dynamic: true, iconURL: user.displayAvatarURL({
format: "png" size: 512,
})}) dynamic: true,
format: "png"
})
})
.setThumbnail(user.displayAvatarURL({ .setThumbnail(user.displayAvatarURL({
dynamic: true dynamic: true
})) }))
@ -59,15 +62,17 @@ class Userinfo extends Command {
format: "png" format: "png"
})) }))
.setColor(data.config.embed.color) .setColor(data.config.embed.color)
.setFooter({ text: data.config.embed.footer }); .setFooter({
text: data.config.embed.footer
});
if (displayPresence) { if (displayPresence) {
embed.addField(this.client.customEmojis.games + " " + message.translate("common:GAME"), (user.presence.activity ? user.presence.activity.name : message.translate("general/userinfo:NO_GAME")), true) embed.addField(this.client.customEmojis.games + " " + message.translate("common:GAME"), (member.presence.activities[0] ? `${member.presence.activities[0].name}\n${member.presence.activities[0].details}\n${member.presence.activities[0].state}` : message.translate("general/userinfo:NO_GAME")), true)
embed.addField(this.client.customEmojis.status[user.presence.status] + " " + message.translate("common:STATUS"), message.translate("common:STATUS_" + (user.presence.status.toUpperCase())), true); embed.addField(this.client.customEmojis.status[member.presence.status] + " " + message.translate("common:STATUS"), message.translate("common:STATUS_" + (member.presence.status.toUpperCase())), true);
}; };
if (member) { if (member) {
embed.addField(this.client.customEmojis.up + " " + message.translate("general/userinfo:ROLE"), (member.roles.highest ? member.roles.highest : message.translate("general/userinfo:NO_ROLE")), true) // embed.addField(this.client.customEmojis.up + " " + message.translate("general/userinfo:ROLE"), (member.roles.highest ? member.roles.highest : message.translate("general/userinfo:NO_ROLE")), true)
embed.addField(this.client.customEmojis.calendar2 + " " + message.translate("common:JOIN"), message.printDate(member.joinedAt), true) embed.addField(this.client.customEmojis.calendar2 + " " + message.translate("common:JOIN"), message.printDate(member.joinedAt), true)
embed.addField(this.client.customEmojis.color + " " + message.translate("common:COLOR"), member.displayHexColor, true) embed.addField(this.client.customEmojis.color + " " + message.translate("common:COLOR"), member.displayHexColor, true)
embed.addField(this.client.customEmojis.pencil + " " + message.translate("common:NICKNAME"), (member.nickname ? member.nickname : message.translate("general/userinfo:NO_NICKNAME")), true) embed.addField(this.client.customEmojis.pencil + " " + message.translate("common:NICKNAME"), (member.nickname ? member.nickname : message.translate("general/userinfo:NO_NICKNAME")), true)
@ -95,7 +100,9 @@ class Userinfo extends Command {
}; };
}; };
message.channel.send({ embeds: [embed] }); message.channel.send({
embeds: [embed]
});
} }
}; };

View file

@ -75,13 +75,20 @@ class Announcement extends Command {
if (reason === "time") return message.error("misc:TIMES_UP"); if (reason === "time") return message.error("misc:TIMES_UP");
const embed = new Discord.MessageEmbed() const embed = new Discord.MessageEmbed()
.setAuthor({ name: message.translate("moderation/announcement:TITLE") }) .setAuthor({
name: message.translate("moderation/announcement:TITLE")
})
.setColor(data.config.embed.color) .setColor(data.config.embed.color)
.setFooter({ text: message.author.tag }) .setFooter({
text: message.author.tag
})
.setTimestamp() .setTimestamp()
.setDescription(text); .setDescription(text);
message.channel.send({ content: mention, embeds: [embed] }); message.channel.send({
content: mention,
embeds: [embed]
});
}); });
} }
}; };

View file

@ -86,14 +86,18 @@ class Ban extends Command {
const channel = message.guild.channels.cache.get(data.guild.plugins.modlogs); const channel = message.guild.channels.cache.get(data.guild.plugins.modlogs);
if (!channel) return; if (!channel) return;
const embed = new Discord.MessageEmbed() const embed = new Discord.MessageEmbed()
.setAuthor({ name: message.translate("moderation/ban:CASE", { .setAuthor({
count: data.guild.casesCount name: message.translate("moderation/ban:CASE", {
})}) count: data.guild.casesCount
})
})
.addField(message.translate("common:USER"), `\`${user.tag}\` (${user.toString()})`, true) .addField(message.translate("common:USER"), `\`${user.tag}\` (${user.toString()})`, true)
.addField(message.translate("common:MODERATOR"), `\`${message.author.tag}\` (${message.author.toString()})`, true) .addField(message.translate("common:MODERATOR"), `\`${message.author.tag}\` (${message.author.toString()})`, true)
.addField(message.translate("common:REASON"), reason, true) .addField(message.translate("common:REASON"), reason, true)
.setColor("#e02316"); .setColor("#e02316");
channel.send({ embeds: [embed] }); channel.send({
embeds: [embed]
});
}; };
}).catch((err) => { }).catch((err) => {

View file

@ -20,7 +20,7 @@ class Checkinvites extends Command {
async run(message, args, data) { async run(message, args, data) {
const withInvite = []; const withInvite = [];
message.guild.members.cache.forEach((m) => { message.guild.members.cache.forEach((m) => {
const possibleLinks = m.user.presence.activities.map((a) => [a.state, a.details, a.name]).flat(); const possibleLinks = m.presence.activities.map((a) => [a.state, a.details, a.name]).flat();
const inviteLinks = possibleLinks.filter((l) => /(discord\.(gg|io|me|li)\/.+|discordapp\.com\/invite\/.+)/i.test(l)); const inviteLinks = possibleLinks.filter((l) => /(discord\.(gg|io|me|li)\/.+|discordapp\.com\/invite\/.+)/i.test(l));
if (inviteLinks.length > 0) { if (inviteLinks.length > 0) {
withInvite.push({ withInvite.push({
@ -36,9 +36,13 @@ class Checkinvites extends Command {
const embed = new Discord.MessageEmbed() const embed = new Discord.MessageEmbed()
.setDescription(text) .setDescription(text)
.setColor(data.config.embed.color) .setColor(data.config.embed.color)
.setFooter({ text: data.config.embed.footer }); .setFooter({
text: data.config.embed.footer
});
const m = await message.channel.send({ embeds: [embed] }); const m = await message.channel.send({
embeds: [embed]
});
setTimeout(function () { setTimeout(function () {
m.delete(); m.delete();

View file

@ -30,7 +30,9 @@ class Clear extends Command {
const newChannel = await message.channel.clone(); const newChannel = await message.channel.clone();
await message.channel.delete(); await message.channel.delete();
newChannel.setPosition(position); newChannel.setPosition(position);
return newChannel.send({ content: message.translate("moderation/clear:CHANNEL_CLEARED") }); return newChannel.send({
content: message.translate("moderation/clear:CHANNEL_CLEARED")
});
}; };
let amount = args[0]; let amount = args[0];

View file

@ -73,14 +73,18 @@ class Kick extends Command {
const channel = message.guild.channels.cache.get(data.guild.plugins.modlogs); const channel = message.guild.channels.cache.get(data.guild.plugins.modlogs);
if (!channel) return; if (!channel) return;
const embed = new Discord.MessageEmbed() const embed = new Discord.MessageEmbed()
.setAuthor({ name: message.translate("moderation/kick:CASE", { .setAuthor({
count: data.guild.casesCount name: message.translate("moderation/kick:CASE", {
})}) count: data.guild.casesCount
})
})
.addField(message.translate("common:USER"), `\`${member.user.tag}\` (${member.user.toString()})`, true) .addField(message.translate("common:USER"), `\`${member.user.tag}\` (${member.user.toString()})`, true)
.addField(message.translate("common:MODERATOR"), `\`${message.author.tag}\` (${message.author.toString()})`, true) .addField(message.translate("common:MODERATOR"), `\`${message.author.tag}\` (${message.author.toString()})`, true)
.addField(message.translate("common:REASON"), reason, true) .addField(message.translate("common:REASON"), reason, true)
.setColor("#e88709"); .setColor("#e88709");
channel.send({ embeds: [embed] }); channel.send({
embeds: [embed]
});
}; };
}).catch(() => { }).catch(() => {

View file

@ -90,16 +90,20 @@ class Mute extends Command {
const channel = message.guild.channels.cache.get(data.guild.plugins.modlogs); const channel = message.guild.channels.cache.get(data.guild.plugins.modlogs);
if (!channel) return; if (!channel) return;
const embed = new Discord.MessageEmbed() const embed = new Discord.MessageEmbed()
.setAuthor({ name: message.translate("moderation/mute:CASE", { .setAuthor({
count: data.guild.casesCount name: message.translate("moderation/mute:CASE", {
})}) count: data.guild.casesCount
})
})
.addField(message.translate("common:USER"), `\`${member.user.tag}\` (${member.user.toString()})`, true) .addField(message.translate("common:USER"), `\`${member.user.tag}\` (${member.user.toString()})`, true)
.addField(message.translate("common:MODERATOR"), `\`${message.author.tag}\` (${message.author.toString()})`, true) .addField(message.translate("common:MODERATOR"), `\`${message.author.tag}\` (${message.author.toString()})`, true)
.addField(message.translate("common:REASON"), reason, true) .addField(message.translate("common:REASON"), reason, true)
.addField(message.translate("common:DURATION"), time, true) .addField(message.translate("common:DURATION"), time, true)
.addField(message.translate("common:EXPIRY"), message.printDate(new Date(Date.now() + ms(time))), true) .addField(message.translate("common:EXPIRY"), message.printDate(new Date(Date.now() + ms(time))), true)
.setColor("#f44271"); .setColor("#f44271");
channel.send({ embeds: [embed] }); channel.send({
embeds: [embed]
});
} }
} }
}; };

View file

@ -83,14 +83,19 @@ class Poll extends Command {
]; ];
const embed = new Discord.MessageEmbed() const embed = new Discord.MessageEmbed()
.setAuthor({ name: message.translate("moderation/poll:TITLE") }) .setAuthor({
name: message.translate("moderation/poll:TITLE")
})
.setColor(data.config.embed.color) .setColor(data.config.embed.color)
.addField(question, message.translate("moderation/poll:REACT", { .addField(question, message.translate("moderation/poll:REACT", {
success: emojis[0].toString(), success: emojis[0].toString(),
error: emojis[1].toString() error: emojis[1].toString()
})); }));
message.channel.send({ content: mention, embeds: [embed] }).then(async (m) => { message.channel.send({
content: mention,
embeds: [embed]
}).then(async (m) => {
await m.react(emojis[0]); await m.react(emojis[0]);
await m.react(emojis[1]); await m.react(emojis[1]);
}); });

View file

@ -27,25 +27,34 @@ class Sanctions extends Command {
}); });
const embed = new Discord.MessageEmbed() const embed = new Discord.MessageEmbed()
.setAuthor({ name: user.tag, iconURL: user.displayAvatarURL({ .setAuthor({
size: 512, name: user.tag,
dynamic: true, iconURL: user.displayAvatarURL({
format: "png" size: 512,
})}) dynamic: true,
format: "png"
})
})
.setColor(data.config.embed.color) .setColor(data.config.embed.color)
.setFooter({ text: data.config.embed.footer }); .setFooter({
text: data.config.embed.footer
});
if (memberData.sanctions.length < 1) { if (memberData.sanctions.length < 1) {
embed.setDescription(message.translate("moderation/sanctions:NO_SANCTION", { embed.setDescription(message.translate("moderation/sanctions:NO_SANCTION", {
username: user.tag username: user.tag
})); }));
return message.channel.send({ embeds: [embed] }); return message.channel.send({
embeds: [embed]
});
} else { } else {
memberData.sanctions.forEach((s) => { memberData.sanctions.forEach((s) => {
embed.addField(s.type + " | #" + s.case, `${message.translate("common:MODERATOR")}: <@${s.moderator}>\n${message.translate("common:REASON")}: ${s.reason}`, true); embed.addField(s.type + " | #" + s.case, `${message.translate("common:MODERATOR")}: <@${s.moderator}>\n${message.translate("common:REASON")}: ${s.reason}`, true);
}); });
}; };
message.channel.send({ embeds: [embed] }); message.channel.send({
embeds: [embed]
});
} }
}; };

View file

@ -67,9 +67,11 @@ class Warn extends Command {
reason reason
})); }));
caseInfo.type = "ban"; caseInfo.type = "ban";
embed.setAuthor({ name: message.translate("moderation/ban:CASE", { embed.setAuthor({
count: data.guild.casesCount name: message.translate("moderation/ban:CASE", {
})}) count: data.guild.casesCount
})
})
.setColor("#e02316"); .setColor("#e02316");
message.guild.members.ban(member).catch(() => {}); message.guild.members.ban(member).catch(() => {});
message.success("moderation/setwarns:AUTO_BAN", { message.success("moderation/setwarns:AUTO_BAN", {
@ -88,9 +90,11 @@ class Warn extends Command {
reason reason
})); }));
caseInfo.type = "kick"; caseInfo.type = "kick";
embed.setAuthor({ name: message.translate("moderation/kick:CASE", { embed.setAuthor({
count: data.guild.casesCount name: message.translate("moderation/kick:CASE", {
})}) count: data.guild.casesCount
})
})
.setColor("#e88709"); .setColor("#e88709");
member.kick().catch(() => {}); member.kick().catch(() => {});
message.success("moderation/setwarns:AUTO_KICK", { message.success("moderation/setwarns:AUTO_KICK", {
@ -107,9 +111,11 @@ class Warn extends Command {
reason reason
})); }));
caseInfo.type = "warn"; caseInfo.type = "warn";
embed.setAuthor({ name: message.translate("moderation/warn:CASE", { embed.setAuthor({
caseNumber: data.guild.casesCount name: message.translate("moderation/warn:CASE", {
})}) caseNumber: data.guild.casesCount
})
})
.setColor("#8c14e2"); .setColor("#8c14e2");
message.success("moderation/warn:WARNED", { message.success("moderation/warn:WARNED", {
username: member.user.tag, username: member.user.tag,
@ -122,7 +128,9 @@ class Warn extends Command {
if (data.guild.plugins.modlogs) { if (data.guild.plugins.modlogs) {
const channel = message.guild.channels.cache.get(data.guild.plugins.modlogs); const channel = message.guild.channels.cache.get(data.guild.plugins.modlogs);
if (!channel) return; if (!channel) return;
channel.send({ embeds: [embed] }); channel.send({
embeds: [embed]
});
}; };
} }
}; };

View file

@ -26,16 +26,24 @@ class Back extends Command {
if (!queue.previousSongs[0]) return message.error("music/back:NO_PREV_SONG"); if (!queue.previousSongs[0]) return message.error("music/back:NO_PREV_SONG");
const embed = new Discord.MessageEmbed() const embed = new Discord.MessageEmbed()
.setAuthor({ name: message.translate("music/back:DESCRIPTION") }) .setAuthor({
name: message.translate("music/back:DESCRIPTION")
})
.setThumbnail(queue.tracks[0].thumbnail) .setThumbnail(queue.tracks[0].thumbnail)
.setColor(data.config.embed.color) .setColor(data.config.embed.color)
.setFooter({ text: data.config.embed.footer }); .setFooter({
text: data.config.embed.footer
});
const m = await message.channel.send({ embeds: [embed] }); const m = await message.channel.send({
embeds: [embed]
});
this.client.player.previous(message); this.client.player.previous(message);
embed.setDescription(message.translate("music/back:SUCCESS")); embed.setDescription(message.translate("music/back:SUCCESS"));
m.edit({ embeds: [embed] }); m.edit({
embeds: [embed]
});
} }
}; };

View file

@ -32,9 +32,13 @@ class Clips extends Command {
.setTitle(message.translate("music/clips:EMBED_TITLE")) .setTitle(message.translate("music/clips:EMBED_TITLE"))
.setDescription(clips.join("\n")) .setDescription(clips.join("\n"))
.setColor(data.config.embed.color) .setColor(data.config.embed.color)
.setFooter({ text: data.config.embed.footer }) .setFooter({
text: data.config.embed.footer
})
.setTimestamp(); .setTimestamp();
message.channel.send({ embeds: [embed] }); message.channel.send({
embeds: [embed]
});
}); });
} }
}; };

View file

@ -39,7 +39,9 @@ class Filters extends Command {
.addField("** **", filtersStatuses[1].join("\n"), true) .addField("** **", filtersStatuses[1].join("\n"), true)
.setColor(data.config.embed.color); .setColor(data.config.embed.color);
message.channel.send({ embeds: [list] }); message.channel.send({
embeds: [list]
});
} }
}; };

View file

@ -27,18 +27,26 @@ class Jump extends Command {
if (number < 0) return message.error("music/jump:NO_PREV_SONG", { prefix: data.guild.prefix }); if (number < 0) return message.error("music/jump:NO_PREV_SONG", { prefix: data.guild.prefix });
const embed = new Discord.MessageEmbed() const embed = new Discord.MessageEmbed()
.setAuthor({ name: message.translate("music/jump:SUCCESS") }) .setAuthor({
name: message.translate("music/jump:SUCCESS")
})
.setThumbnail(queue.songs[number].thumbnail) .setThumbnail(queue.songs[number].thumbnail)
.setFooter({ text: data.config.embed.footer }) .setFooter({
text: data.config.embed.footer
})
.setColor(data.config.embed.color); .setColor(data.config.embed.color);
const m = await message.channel.send({ embeds: [embed] }); const m = await message.channel.send({
embeds: [embed]
});
this.client.player.jump(message, number); this.client.player.jump(message, number);
embed.setDescription(message.translate("music/play:NOW_PLAYING", { embed.setDescription(message.translate("music/play:NOW_PLAYING", {
songName: queue.songs[number].name songName: queue.songs[number].name
})); }));
m.edit({ embeds: [embed] }); m.edit({
embeds: [embed]
});
} }
}; };

View file

@ -27,7 +27,9 @@ class Lyrics extends Command {
songName songName
})) }))
.setColor(data.config.embed.color) .setColor(data.config.embed.color)
.setFooter({ text: data.config.embed.footer }); .setFooter({
text: data.config.embed.footer
});
try { try {
const songNameFormated = songName const songNameFormated = songName
@ -46,7 +48,9 @@ class Lyrics extends Command {
}; };
embed.setDescription(lyrics); embed.setDescription(lyrics);
message.channel.send({ embeds: [embed] }); message.channel.send({
embeds: [embed]
});
} catch (e) { } catch (e) {
console.log(e); console.log(e);

View file

@ -29,17 +29,23 @@ class Np extends Command {
// Generate discord embed to display song informations // Generate discord embed to display song informations
const embed = new Discord.MessageEmbed() const embed = new Discord.MessageEmbed()
.setAuthor({ name: message.translate("music/queue:TITLE") }) .setAuthor({
name: message.translate("music/queue:TITLE")
})
.setThumbnail(track.thumbnail) .setThumbnail(track.thumbnail)
.addField(message.translate("music/np:T_TITLE"), `[${track.name}](${track.url})`) .addField(message.translate("music/np:T_TITLE"), `[${track.name}](${track.url})`)
.addField(message.translate("music/np:T_CHANNEL"), track.uploader.name ? track.uploader.name : "Отсутствует") .addField(message.translate("music/np:T_CHANNEL"), track.uploader.name ? track.uploader.name : "Отсутствует")
.addField(message.translate("music/np:T_DURATION"), `${queue.formattedCurrentTime} / ${track.formattedDuration}`) .addField(message.translate("music/np:T_DURATION"), `${queue.formattedCurrentTime} / ${track.formattedDuration}`)
.setColor(data.config.embed.color) .setColor(data.config.embed.color)
.setFooter({ text: data.config.embed.footer }) .setFooter({
text: data.config.embed.footer
})
.setTimestamp(); .setTimestamp();
// Send the embed in the current channel // Send the embed in the current channel
message.channel.send({ embeds: [embed] }); message.channel.send({
embeds: [embed]
});
} }
}; };

View file

@ -27,21 +27,29 @@ class Queue extends Command {
if (queue.songs.length === 1) { if (queue.songs.length === 1) {
const embed = new Discord.MessageEmbed() const embed = new Discord.MessageEmbed()
.setAuthor({ name: message.translate("music/queue:TITLE"), iconURL: message.guild.iconURL({ .setAuthor({
dynamic: true name: message.translate("music/queue:TITLE"),
})}) iconURL: message.guild.iconURL({
dynamic: true
})
})
.addField(message.translate("music/np:CURRENTLY_PLAYING"), `[${queue.songs[0].name}](${queue.songs[0].url})\n*Добавил ${queue.songs[0].member}*\n`) .addField(message.translate("music/np:CURRENTLY_PLAYING"), `[${queue.songs[0].name}](${queue.songs[0].url})\n*Добавил ${queue.songs[0].member}*\n`)
.setColor(data.config.embed.color); .setColor(data.config.embed.color);
return message.channel.send({ embeds: [embed] }); return message.channel.send({
embeds: [embed]
});
}; };
const FieldsEmbed = new Pagination.FieldsEmbed(); const FieldsEmbed = new Pagination.FieldsEmbed();
FieldsEmbed.embed FieldsEmbed.embed
.setColor(data.config.embed.color) .setColor(data.config.embed.color)
.setAuthor({ name: message.translate("music/queue:TITLE"), iconURL: message.guild.iconURL({ .setAuthor({
dynamic: true name: message.translate("music/queue:TITLE"),
})}) iconURL: message.guild.iconURL({
dynamic: true
})
})
.addField(message.translate("music/np:CURRENTLY_PLAYING"), `[${queue.songs[0].name}](${queue.songs[0].url})\n*Добавил ${queue.songs[0].member}*\n`); .addField(message.translate("music/np:CURRENTLY_PLAYING"), `[${queue.songs[0].name}](${queue.songs[0].url})\n*Добавил ${queue.songs[0].member}*\n`);
FieldsEmbed.setArray(queue.songs[1] ? queue.songs.slice(1, queue.songs.length) : []) FieldsEmbed.setArray(queue.songs[1] ? queue.songs.slice(1, queue.songs.length) : [])

View file

@ -20,11 +20,10 @@ class Seek extends Command {
async run(message, args) { async run(message, args) {
const voice = message.member.voice.channel; const voice = message.member.voice.channel;
const queue = this.client.player.getQueue(message); const queue = this.client.player.getQueue(message);
const time = ms(args[0]);
if (!voice) return message.error("music/play:NO_VOICE_CHANNEL"); if (!voice) return message.error("music/play:NO_VOICE_CHANNEL");
if (!queue) return message.error("music/play:NOT_PLAYING"); if (!queue) return message.error("music/play:NOT_PLAYING");
const time = ms(args[0]);
if (isNaN(time)) return message.error("music/seek:INVALID_TIME"); if (isNaN(time)) return message.error("music/seek:INVALID_TIME");
await this.client.player.seek(message, time); await this.client.player.seek(message, time);

View file

@ -26,18 +26,26 @@ class Skip extends Command {
if (!queue.songs[1]) return message.error("music/skip:NO_NEXT_SONG"); if (!queue.songs[1]) return message.error("music/skip:NO_NEXT_SONG");
const embed = new Discord.MessageEmbed() const embed = new Discord.MessageEmbed()
.setAuthor({ name: message.translate("music/skip:SUCCESS") }) .setAuthor({
name: message.translate("music/skip:SUCCESS")
})
.setThumbnail(queue.songs[1].thumbnail) .setThumbnail(queue.songs[1].thumbnail)
.setFooter({ text: data.config.embed.footer }) .setFooter({
text: data.config.embed.footer
})
.setColor(data.config.embed.color); .setColor(data.config.embed.color);
const m = await message.channel.send({ embeds: [embed] }); const m = await message.channel.send({
embeds: [embed]
});
this.client.player.skip(message); this.client.player.skip(message);
embed.setDescription(message.translate("music/play:NOW_PLAYING", { embed.setDescription(message.translate("music/play:NOW_PLAYING", {
songName: queue.songs[1].name songName: queue.songs[1].name
})); }));
m.edit({ embeds: [embed] }); m.edit({
embeds: [embed]
});
} }
}; };

View file

@ -25,15 +25,23 @@ class Stop extends Command {
if (!queue) return message.error("music/play:NOT_PLAYING"); if (!queue) return message.error("music/play:NOT_PLAYING");
const embed = new Discord.MessageEmbed() const embed = new Discord.MessageEmbed()
.setAuthor({ name: message.translate("music/stop:DESCRIPTION") }) .setAuthor({
.setFooter({ text: data.config.embed.footer }) name: message.translate("music/stop:DESCRIPTION")
})
.setFooter({
text: data.config.embed.footer
})
.setColor(data.config.embed.color); .setColor(data.config.embed.color);
const m = await message.channel.send({ embeds: [embed] }); const m = await message.channel.send({
embeds: [embed]
});
this.client.player.stop(message); this.client.player.stop(message);
embed.setDescription(message.translate("music/stop:SUCCESS")); embed.setDescription(message.translate("music/stop:SUCCESS"));
m.edit({ embeds: [embed] }); m.edit({
embeds: [embed]
});
} }
}; };

View file

@ -23,7 +23,9 @@ class Hentai extends Command {
var gif = null; var gif = null;
const embed = new Discord.MessageEmbed() const embed = new Discord.MessageEmbed()
.setColor(data.config.embed.color) .setColor(data.config.embed.color)
.setFooter({ text: data.config.embed.footer }) .setFooter({
text: data.config.embed.footer
})
.setTimestamp() .setTimestamp()
switch (category) { switch (category) {
@ -95,7 +97,9 @@ class Hentai extends Command {
})) }))
break; break;
}; };
message.channel.send({ embeds: [embed] }); message.channel.send({
embeds: [embed]
});
} }
}; };

View file

@ -25,12 +25,16 @@ class Eval extends Command {
depth: 0 depth: 0
}); });
if (output.includes(this.client.token)) output = output.replace(this.client.token, "T0K3N"); if (output.includes(this.client.token)) output = output.replace(this.client.token, "T0K3N");
message.channel.send({ content: "```js\n" + output + "```" }); message.channel.send({
content: "```js\n" + output + "```"
});
}).catch((err) => { }).catch((err) => {
console.error(err); console.error(err);
err = err.toString(); err = err.toString();
if (err.includes(this.client.token)) err = err.replace(this.client.token, "T0K3N"); if (err.includes(this.client.token)) err = err.replace(this.client.token, "T0K3N");
message.channel.send({ content: "```js\n" + err + "```" }); message.channel.send({
content: "```js\n" + err + "```"
});
}); });
} }
}; };

View file

@ -20,7 +20,7 @@ class Reload extends Command {
async run(message, args, data) { async run(message, args, data) {
const command = args[0]; const command = args[0];
const cmd = this.client.commands.get(command) || this.client.commands.get(this.client.aliases.get(command)); const cmd = this.client.commands.get(command) || this.client.commands.get(this.client.aliases.get(command));
if (!cmd) message.error("owner/reload:NOT_FOUND", { search: command }); if (!cmd) return message.error("owner/reload:NOT_FOUND", { search: command });
await this.client.unloadCommand(cmd.conf.location, cmd.help.name); await this.client.unloadCommand(cmd.conf.location, cmd.help.name);
await this.client.loadCommand(cmd.conf.location, cmd.help.name); await this.client.loadCommand(cmd.conf.location, cmd.help.name);

View file

@ -36,7 +36,9 @@ class Say extends Command {
content: args[0], content: args[0],
files: [attachment] files: [attachment]
}); });
else saychannel.send({ content: args[0] }); else saychannel.send({
content: args[0]
});
}, 2000); }, 2000);
} else if (args[2]) { } else if (args[2]) {
const saychannel = this.client.guilds.cache.find(guild => guild.name == args[2] || guild.id == args[2]).channels.cache.find(channel => channel.name == args[1] || channel.id == args[1]); const saychannel = this.client.guilds.cache.find(guild => guild.name == args[2] || guild.id == args[2]).channels.cache.find(channel => channel.name == args[1] || channel.id == args[1]);
@ -47,7 +49,9 @@ class Say extends Command {
content: args[0], content: args[0],
files: [attachment] files: [attachment]
}); });
else saychannel.send({ content: args[0] }); else saychannel.send({
content: args[0]
});
}, 2000); }, 2000);
} else { } else {
message.delete(); message.delete();
@ -59,7 +63,9 @@ class Say extends Command {
content: args[0], content: args[0],
files: [attachment] files: [attachment]
}); });
else saychannel.send({ content: args[0] }); else saychannel.send({
content: args[0]
});
}, 2000); }, 2000);
}; };
} }

View file

@ -31,24 +31,32 @@ class ServersList extends Command {
.join("\n"); .join("\n");
const embed = new Discord.MessageEmbed() const embed = new Discord.MessageEmbed()
.setAuthor({ name: message.author.tag, iconURL: message.author.displayAvatarURL({ .setAuthor({
size: 512, name: message.author.tag,
dynamic: true, iconURL: message.author.displayAvatarURL({
format: "png" size: 512,
})}) dynamic: true,
format: "png"
})
})
.setColor(data.config.embed.color) .setColor(data.config.embed.color)
.setFooter({ text: this.client.user.username }) .setFooter({
text: this.client.user.username
})
.setTitle(`${message.translate("common:PAGE")}: ${page}/${Math.ceil(this.client.guilds.cache.size/10)}`) .setTitle(`${message.translate("common:PAGE")}: ${page}/${Math.ceil(this.client.guilds.cache.size/10)}`)
.setDescription(description); .setDescription(description);
const msg = await message.channel.send({ embeds: [embed] }); const msg = await message.channel.send({
embeds: [embed]
});
await msg.react("⬅"); await msg.react("⬅");
await msg.react("➡"); await msg.react("➡");
await msg.react("❌"); await msg.react("❌");
const filter = (reaction, user) => user.id === message.author.id; const filter = (reaction, user) => user.id === message.author.id;
const collector = msg.createReactionCollector({ filter, const collector = msg.createReactionCollector({
filter,
time: 30000 time: 30000
}); });
@ -74,7 +82,9 @@ class ServersList extends Command {
.setDescription(description); .setDescription(description);
// Edit the message // Edit the message
msg.edit({ embeds: [embed] }); msg.edit({
embeds: [embed]
});
}; };
if (reaction._emoji.name === "➡") { if (reaction._emoji.name === "➡") {
@ -98,7 +108,9 @@ class ServersList extends Command {
.setDescription(description); .setDescription(description);
// Edit the message // Edit the message
msg.edit({ embeds: [embed] }); msg.edit({
embeds: [embed]
});
}; };
if (reaction._emoji.name === "❌") return msg.delete(); if (reaction._emoji.name === "❌") return msg.delete();

View file

@ -37,7 +37,7 @@ async function fetchUser(userData, client, query) {
}; };
const user = await client.users.fetch(userData.id); const user = await client.users.fetch(userData.id);
const userDb = await client.findOrCreateUser({ id: user.id }, true); const userDb = await client.findOrCreateUser({ id: user.id }, true);
const userInfos = { ...user.toJSON(), ...userDb, ...userData, ...user.presence }; const userInfos = { ...user.toJSON(), ...userDb, ...userData };
return userInfos; return userInfos;
}; };

View file

@ -9,9 +9,6 @@
</div> </div>
<div class="pull-left info"> <div class="pull-left info">
<p><%= user.username %></p> <p><%= user.username %></p>
<a href="#"><i
class="fa fa-circle text-<%= user.status === "dnd" ? "danger" : user.status === "idle" ? "warning" : user.status === "online" ? "success" : ""%>"></i>
<%= translate("common:STATUS_" + user.status.toUpperCase()) %></a>
</div> </div>
</div> </div>
<!-- search form --> <!-- search form -->
@ -72,6 +69,6 @@
$(`.sidebar-menu > li > a[href="${pathname}"]`).parent().addClass("active"); $(`.sidebar-menu > li > a[href="${pathname}"]`).parent().addClass("active");
$(`.sidebar-menu > li > ul > li > a[href="${window.location.pathname}"]`).parent().addClass("active"); $(`.sidebar-menu > li > ul > li > a[href="${window.location.pathname}"]`).parent().addClass("active");
$(`.sidebar-menu > li > a[href="/${window.location.pathname.split("/")[1]}/"]`).parent().addClass( $(`.sidebar-menu > li > a[href="/${window.location.pathname.split("/")[1]}/"]`).parent().addClass(
"active"); "active");
}); });
</script> </script>

View file

@ -9,6 +9,8 @@
"SUCCESS_PUBLIC": "Резервная копия успешно создана! ID резервной копии был отправлен вам в ЛС!", "SUCCESS_PUBLIC": "Резервная копия успешно создана! ID резервной копии был отправлен вам в ЛС!",
"SUCCESS_PRIVATE": "Вот ID вашей резервной копии: `{{backupID}}`, используйте его для восстановления на другом сервере!", "SUCCESS_PRIVATE": "Вот ID вашей резервной копии: `{{backupID}}`, используйте его для восстановления на другом сервере!",
"CONFIRMATION": ":warning: | **Загрузка резервной копии заменит настройки текущего сервера.**\n\n:arrow_right_hook: *Отправьте `confirm` для подтверждения!*", "CONFIRMATION": ":warning: | **Загрузка резервной копии заменит настройки текущего сервера.**\n\n:arrow_right_hook: *Отправьте `confirm` для подтверждения!*",
"REMOVE_CONFIRMATION": ":warning: | **Вы уверены что хотите удалить резервную копию? Это действие необратимо**\n\n:arrow_right_hook: *Отправьте `confirm` для подтверждения!*",
"SUCCESS_REMOVED": "Резервная копия успешно удалена!",
"START_LOADING": "Загрузка резервной копии начата, подождите!", "START_LOADING": "Загрузка резервной копии начата, подождите!",
"LOAD_SUCCESS": "Резервная копия загружена!", "LOAD_SUCCESS": "Резервная копия загружена!",
"TITLE_INFO": "Информация о резервной копии", "TITLE_INFO": "Информация о резервной копии",