JaBa/commands/Economy/achievements.js

72 lines
3.3 KiB
JavaScript
Raw Normal View History

2021-12-10 21:39:54 +05:00
const Command = require("../../base/Command.js"),
Discord = require("discord.js");
class Achievements extends Command {
2021-12-26 19:29:37 +05:00
constructor(client) {
2021-12-10 21:39:54 +05:00
super(client, {
name: "achievements",
dirname: __dirname,
enabled: true,
guildOnly: false,
2021-12-26 19:29:37 +05:00
aliases: ["ac"],
2021-12-10 21:39:54 +05:00
memberPermissions: [],
2021-12-26 19:29:37 +05:00
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
2021-12-10 21:39:54 +05:00
nsfw: false,
ownerOnly: false,
cooldown: 1000
});
}
2021-12-26 19:29:37 +05:00
async run(message, args, data) {
2021-12-10 21:39:54 +05:00
const embed = new Discord.MessageEmbed()
2022-01-04 00:35:11 +05:00
.setAuthor({
name: message.translate("economy/achievements:TITLE")
})
2021-12-10 21:39:54 +05:00
.setColor(data.config.embed.color)
2022-01-04 00:35:11 +05:00
.setFooter({
text: data.config.embed.footer
});
2021-12-10 21:39:54 +05:00
embed.addField(message.translate("economy/achievements:SEND_CMD"), message.translate("economy/achievements:PROGRESS", {
now: data.userData.achievements.firstCommand.progress.now,
total: data.userData.achievements.firstCommand.progress.total,
2021-12-26 19:29:37 +05:00
percent: Math.round(100 * (data.userData.achievements.firstCommand.progress.now / data.userData.achievements.firstCommand.progress.total))
2021-12-10 21:39:54 +05:00
}));
embed.addField(message.translate("economy/achievements:CLAIM_SALARY"), message.translate("economy/achievements:PROGRESS", {
now: data.userData.achievements.work.progress.now,
total: data.userData.achievements.work.progress.total,
2021-12-26 19:29:37 +05:00
percent: Math.round(100 * (data.userData.achievements.work.progress.now / data.userData.achievements.work.progress.total))
2021-12-10 21:39:54 +05:00
}));
embed.addField(message.translate("economy/achievements:MARRY"), message.translate("economy/achievements:PROGRESS", {
now: data.userData.achievements.married.progress.now,
total: data.userData.achievements.married.progress.total,
2021-12-26 19:29:37 +05:00
percent: Math.round(100 * (data.userData.achievements.married.progress.now / data.userData.achievements.married.progress.total))
2021-12-10 21:39:54 +05:00
}));
embed.addField(message.translate("economy/achievements:SLOTS"), message.translate("economy/achievements:PROGRESS", {
now: data.userData.achievements.slots.progress.now,
total: data.userData.achievements.slots.progress.total,
2021-12-26 19:29:37 +05:00
percent: Math.round(100 * (data.userData.achievements.slots.progress.now / data.userData.achievements.slots.progress.total))
2021-12-10 21:39:54 +05:00
}));
embed.addField(message.translate("economy/achievements:TIP"), message.translate("economy/achievements:PROGRESS", {
now: data.userData.achievements.tip.progress.now,
total: data.userData.achievements.tip.progress.total,
2021-12-26 19:29:37 +05:00
percent: Math.round(100 * (data.userData.achievements.tip.progress.now / data.userData.achievements.tip.progress.total))
2021-12-10 21:39:54 +05:00
}));
embed.addField(message.translate("economy/achievements:REP"), message.translate("economy/achievements:PROGRESS", {
now: data.userData.achievements.rep.progress.now,
total: data.userData.achievements.rep.progress.total,
2021-12-26 19:29:37 +05:00
percent: Math.round(100 * (data.userData.achievements.rep.progress.now / data.userData.achievements.rep.progress.total))
2021-12-10 21:39:54 +05:00
}));
embed.addField(message.translate("economy/achievements:INVITE"), message.translate("economy/achievements:PROGRESS", {
now: data.userData.achievements.invite.progress.now,
total: data.userData.achievements.invite.progress.total,
2021-12-26 19:29:37 +05:00
percent: Math.round(100 * (data.userData.achievements.invite.progress.now / data.userData.achievements.invite.progress.total))
2021-12-10 21:39:54 +05:00
}));
2022-01-04 00:35:11 +05:00
message.channel.send({
embeds: [embed]
});
2021-12-10 21:39:54 +05:00
}
};
module.exports = Achievements;