diff --git a/commands/Administration/setfortniteshop.js b/commands/Administration/setfortniteshop.js index 1392ca29..d3b444a7 100644 --- a/commands/Administration/setfortniteshop.js +++ b/commands/Administration/setfortniteshop.js @@ -51,7 +51,7 @@ class Setfortniteshop extends Command { const attachment = new Discord.MessageAttachment(image, "shop.png"); const embed = new Discord.MessageEmbed() - .setAuthor(this.client.translate("general/fortniteshop:DATE", { date: this.client.printDate(new Date(Date.now()), null, message.guild.data.language) }, message.guild.data.language), this.client.user.displayAvatarURL({ size: 512, dynamic: true, format: 'png' })) + .setAuthor(this.client.translate("general/fortniteshop:DATE", { date: this.client.printDate(new Date(Date.now()), null, message.guild.data.language) }, message.guild.data.language), this.client.user.displayAvatarURL({ size: 512, dynamic: true, format: "png" })) .attachFiles(attachment) .setImage("attachment://shop.png") .setColor(this.client.config.embed.color) diff --git a/commands/Economy/money.js b/commands/Economy/money.js index 320de8ed..527d56c9 100644 --- a/commands/Economy/money.js +++ b/commands/Economy/money.js @@ -43,7 +43,7 @@ class Credits extends Command { const embed = new Discord.MessageEmbed() .setAuthor(message.translate("economy/money:TITLE", { username: member.user.username - }), member.user.displayAvatarURL({ size: 512, dynamic: true, format: 'png' })) + }), member.user.displayAvatarURL({ size: 512, dynamic: true, format: "png" })) .addField(message.translate("economy/profile:CASH"), message.translate("economy/profile:MONEY", { money: memberData.money }), true) diff --git a/commands/Economy/profile.js b/commands/Economy/profile.js index 091c2ecd..bfdd5672 100644 --- a/commands/Economy/profile.js +++ b/commands/Economy/profile.js @@ -51,7 +51,7 @@ class Profile extends Command { const profileEmbed = new Discord.MessageEmbed() .setAuthor(message.translate("economy/profile:TITLE", { username: member.user.tag - }), member.user.displayAvatarURL({ size: 512, dynamic: true, format: 'png' })) + }), member.user.displayAvatarURL({ size: 512, dynamic: true, format: "png" })) .attachFiles([{ attachment: await userData.getAchievements(), name: "achievements.png" }]) .setImage("attachment://achievements.png") .setDescription(userData.bio ? userData.bio : message.translate("economy/profile:NO_BIO")) diff --git a/commands/Economy/slots.js b/commands/Economy/slots.js index eb07d5d9..24d80e74 100644 --- a/commands/Economy/slots.js +++ b/commands/Economy/slots.js @@ -68,15 +68,15 @@ class Slots extends Command { k2 = (k2 < fruits.length - 1) ? k2 + 1 : 0; k3 = (k3 < fruits.length - 1) ? k3 + 1 : 0; - msg += colonnes[0][i1] + " : " + colonnes[1][j1] + " : "+ colonnes[2][k1] + "\n"; - msg += colonnes[0][i2] + " : " + colonnes[1][j2] + " : "+ colonnes[2][k2] + " **<**\n"; - msg += colonnes[0][i3] + " : " + colonnes[1][j3] + " : "+ colonnes[2][k3] + "\n------------------\n"; + msg += colonnes[0][i1] + " : " + colonnes[1][j1] + " : " + colonnes[2][k1] + "\n"; + msg += colonnes[0][i2] + " : " + colonnes[1][j2] + " : " + colonnes[2][k2] + " **<**\n"; + msg += colonnes[0][i3] + " : " + colonnes[1][j3] + " : " + colonnes[2][k3] + "\n------------------\n"; if ((colonnes[0][i2] == colonnes[1][j2]) && (colonnes[1][j2] == colonnes[2][k2])) { - msg += "| : : : **"+(message.translate("common:VICTORY").toUpperCase())+"** : : : |"; + msg += "| : : : **" + (message.translate("common:VICTORY").toUpperCase()) + "** : : : |"; tmsg.edit(msg); const credits = getCredits(amount, true); - message.channel.send("**!! ДЖЕКПОТ !!**\n"+message.translate("economy/slots:VICTORY", { money: amount, won: credits, username: message.author.username })); + message.channel.send("**!! ДЖЕКПОТ !!**\n" + message.translate("economy/slots:VICTORY", { money: amount, won: credits, username: message.author.username })); const toAdd = credits - amount; data.memberData.money = data.memberData.money + toAdd; if (!data.userData.achievements.slots.achieved) { @@ -93,7 +93,7 @@ class Slots extends Command { }; if (colonnes[0][i2] == colonnes[1][j2] || colonnes[1][j2] == colonnes[2][k2] || colonnes[0][i2] == colonnes[2][k2]) { - msg += "| : : : **"+(message.translate("common:VICTORY").toUpperCase())+"** : : : |"; + msg += "| : : : **" + (message.translate("common:VICTORY").toUpperCase()) + "** : : : |"; tmsg.edit(msg); const credits = getCredits(amount, false); message.channel.send(message.translate("economy/slots:VICTORY", { @@ -116,7 +116,7 @@ class Slots extends Command { return; }; - msg += "| : : : **"+(message.translate("common:DEFEAT").toUpperCase())+"** : : : |"; + msg += "| : : : **" + (message.translate("common:DEFEAT").toUpperCase()) + "** : : : |"; message.channel.send(message.translate("economy/slots:DEFEAT", { money: amount, username: message.author.username diff --git a/commands/Economy/work.js b/commands/Economy/work.js index 82e9c9c0..d0c83af4 100644 --- a/commands/Economy/work.js +++ b/commands/Economy/work.js @@ -38,7 +38,7 @@ class Work extends Command { await data.memberData.save(); const embed = new Discord.MessageEmbed() - .setFooter(message.translate("economy/work:AWARD"), message.author.displayAvatarURL({ size: 512, dynamic: true, format: 'png' })) + .setFooter(message.translate("economy/work:AWARD"), message.author.displayAvatarURL({ size: 512, dynamic: true, format: "png" })) .setColor(data.config.embed.color); const award = [ diff --git a/commands/Fun/findwords.js b/commands/Fun/findwords.js index 9e750418..cc61039b 100644 --- a/commands/Fun/findwords.js +++ b/commands/Fun/findwords.js @@ -94,7 +94,7 @@ class FindWords extends Command { winner: user.username, duration: time, participantCount: participants.length, - participantList: participants.map((p) => "<@"+p+">").join("\n") + participantList: participants.map((p) => `<@${p}>`).join("\n") }); if (participants.length > 1 && data.guild.disabledCategories && !data.guild.disabledCategories.includes("Economy")) { message.sendT("fun/findwords:CREDITS", { winner: user.username }); diff --git a/commands/General/fortniteshop.js b/commands/General/fortniteshop.js index cc9ea3df..89a8f36e 100644 --- a/commands/General/fortniteshop.js +++ b/commands/General/fortniteshop.js @@ -37,7 +37,7 @@ class Fortniteshop extends Command { const attachment = new Discord.MessageAttachment(image, "shop.png"); const embed = new Discord.MessageEmbed() - .setAuthor(message.translate("general/fortniteshop:HEADER", { date: message.printDate(new Date(Date.now())) }), this.client.user.displayAvatarURL({ size: 512, dynamic: true, format: 'png' })) + .setAuthor(message.translate("general/fortniteshop:HEADER", { date: message.printDate(new Date(Date.now())) }), this.client.user.displayAvatarURL({ size: 512, dynamic: true, format: "png" })) .attachFiles(attachment) .setImage("attachment://shop.png") .setColor(this.client.config.embed.color) diff --git a/commands/General/github.js b/commands/General/github.js index a8da549c..a5bdcf0f 100644 --- a/commands/General/github.js +++ b/commands/General/github.js @@ -23,12 +23,12 @@ class Github extends Command { const json = await res.json(); const embed = new Discord.MessageEmbed() - .setAuthor(this.client.user.tag, this.client.user.displayAvatarURL({ size: 512, dynamic: true, format: 'png' })) - .setDescription("["+message.translate("general/github:CLICK_HERE")+"](https://github.com/JonnyBro/JaBa-new)") + .setAuthor(this.client.user.tag, this.client.user.displayAvatarURL({ size: 512, dynamic: true, format: "png" })) + .setDescription(`[${message.translate("general/github:CLICK_HERE")}](https://github.com/JonnyBro/JaBa-new)`) .addField("Stars", json.stargazers_count, true) .addField("Forks", json.forks_count, true) .addField(message.translate("general/github:LANGUAGE"), json.language, true) - .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) .setColor(data.config.embed.color) .setFooter(data.config.embed.footer); diff --git a/commands/General/help.js b/commands/General/help.js index d7f640e7..eded25c3 100644 --- a/commands/General/help.js +++ b/commands/General/help.js @@ -41,7 +41,7 @@ class Help extends Command { .addField(message.translate("general/help:FIELD_USAGE"), usage) .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_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) .setFooter(this.client.config.embed.footer); @@ -70,7 +70,7 @@ class Help extends Command { embed.addField(`${emojis.categories[cat.toLowerCase()]} ${cat} - (${tCommands.size})`, `${tCommands.map((cmd) => `${cmd.help.name}`).join(", ")}`); }); 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(", ")); }; embed.addField("\u200B", message.translate("misc:STATS_FOOTER", { @@ -78,7 +78,7 @@ class Help extends Command { donateLink: "https://qiwi.com/n/JONNYBRO", owner: this.client.config.owner.id })); - embed.setAuthor(message.translate("general/help:TITLE", { name: this.client.user.username }), this.client.user.displayAvatarURL({ size: 512, dynamic: true, format: 'png' })); + embed.setAuthor(message.translate("general/help:TITLE", { name: this.client.user.username }), this.client.user.displayAvatarURL({ size: 512, dynamic: true, format: "png" })); return message.channel.send(embed); } }; diff --git a/commands/General/minecraft.js b/commands/General/minecraft.js index fed648cf..d7f4c4ee 100644 --- a/commands/General/minecraft.js +++ b/commands/General/minecraft.js @@ -60,7 +60,7 @@ class Minecraft extends Command { if (!json) return m.error("general/minecraft:FAILED", null, { edit: true }); - const imgRes = await fetch("https://www.minecraftskinstealer.com/achievement/a.php?i=2&h=Success&t="+ip); + const imgRes = await fetch(`https://www.minecraftskinstealer.com/achievement/a.php?i=2&h=Success&t=${ip}`); const imgAttachment = new Discord.MessageAttachment(await imgRes.buffer(), "success.png"); const mcEmbed = new Discord.MessageEmbed() diff --git a/commands/General/permissions.js b/commands/General/permissions.js index 72dd819c..842d88f6 100644 --- a/commands/General/permissions.js +++ b/commands/General/permissions.js @@ -20,7 +20,7 @@ class Permissions extends Command { async run (message) { const member = message.mentions.members.first() || message.member; - let text = "```\n"+message.translate("general/permissions:TITLE", { user: member.user.username, channel: message.channel.name })+"\n\n"; + let text = "```\n" + `${message.translate("general/permissions:TITLE", { user: member.user.username, channel: message.channel.name })}\n\n`; const mPermissions = message.channel.permissionsFor(member); const total = { denied: 0, @@ -35,7 +35,7 @@ class Permissions extends Command { total.allowed++; }; }); - text += `\n${total.allowed} ✅ | ${total.denied} ❌`+"\n```"; + text += `\n${total.allowed} ✅ | ${total.denied} ❌` + "\n```"; message.channel.send(text); } }; diff --git a/commands/General/quote.js b/commands/General/quote.js index e87c946b..ca0460d4 100644 --- a/commands/General/quote.js +++ b/commands/General/quote.js @@ -20,10 +20,10 @@ class Quote extends Command { async run (message, args, data) { function embed(m) { const embed = new Discord.MessageEmbed() - .setAuthor(m.author.tag, m.author.displayAvatarURL({ size: 512, dynamic: true, format: 'png' })) + .setAuthor(m.author.tag, m.author.displayAvatarURL({ size: 512, dynamic: true, format: "png" })) .setDescription(m.content) .setColor(m.member ? m.member.roles.highest ? m.member.roles.highest.color : data.config.embed.color : data.config.embed.color) - .setFooter(m.guild.name+" | #"+m.channel.name) + .setFooter(m.guild.name + " | #" + m.channel.name) .setTimestamp(m.createdTimestamp); if (m.attachments.size > 0) embed.setImage(m.attachments.first().url); return embed; diff --git a/commands/General/report.js b/commands/General/report.js index 9752f373..3d16b208 100644 --- a/commands/General/report.js +++ b/commands/General/report.js @@ -29,10 +29,10 @@ class Report extends Command { if (!rep) return message.error("general/report:MISSING_REASON"); const embed = new Discord.MessageEmbed() - .setAuthor(message.translate("general/report:TITLE", { user: member.user.tag }), message.author.displayAvatarURL({ size: 512, dynamic: true, format: 'png' })) + .setAuthor(message.translate("general/report:TITLE", { user: member.user.tag }), message.author.displayAvatarURL({ size: 512, dynamic: true, format: "png" })) .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:REASON"), "**"+rep+"**", true) + .addField(message.translate("common:REASON"), `**${rep}**`, true) .addField(message.translate("common:USER"), `\`${member.user.tag}\` (${member.user.toString()})`, true) .setColor(data.config.embed.color) .setFooter(data.config.embed.footer); diff --git a/commands/General/serverinfo.js b/commands/General/serverinfo.js index b809742e..41f724c3 100644 --- a/commands/General/serverinfo.js +++ b/commands/General/serverinfo.js @@ -33,14 +33,14 @@ class Serverinfo extends Command { const embed = new Discord.MessageEmbed() .setAuthor(guild.name, guild.iconURL({ dynamic: true })) .setThumbnail(guild.iconURL({ dynamic: true })) - .addField(this.client.customEmojis.title+message.translate("common:NAME"), guild.name, true) - .addField(this.client.customEmojis.calendar+message.translate("common:CREATION"), message.printDate(guild.createdAt), true) - .addField(this.client.customEmojis.users+message.translate("common:MEMBERS"), message.translate("general/serverinfo:MEMBERS", { count: guild.members.cache.filter(m => !m.user.bot).size })+" | "+message.translate("general/serverinfo:BOTS", { count: guild.members.cache.filter(m => m.user.bot).size }), true) - .addField(this.client.customEmojis.afk+message.translate("general/serverinfo:AFK_CHANNEL"), guild.afkChannel || message.translate("general/serverinfo:NO_AFK_CHANNEL"), true) - .addField(this.client.customEmojis.id+message.translate("common:ID"), guild.id, true) - .addField(this.client.customEmojis.crown+message.translate("common:OWNER"), guild.owner, true) - .addField(this.client.customEmojis.boost+message.translate("general/serverinfo:BOOSTS"), guild.premiumSubscriptionCount || 0, true) - .addField(this.client.customEmojis.channels+message.translate("common:CHANNELS"), message.translate("general/serverinfo:TEXT_CHANNELS", { count: guild.channels.cache.filter(c => c.type === "text").size })+" | "+message.translate("general/serverinfo:VOICE_CHANNELS", { count: guild.channels.cache.filter(c => c.type === "voice").size })+" | "+message.translate("general/serverinfo:CAT_CHANNELS", { count: guild.channels.cache.filter(c => c.type === "category").size }), true) + .addField(this.client.customEmojis.title + message.translate("common:NAME"), guild.name, true) + .addField(this.client.customEmojis.calendar + message.translate("common:CREATION"), message.printDate(guild.createdAt), true) + .addField(this.client.customEmojis.users + message.translate("common:MEMBERS"), message.translate("general/serverinfo:MEMBERS", { count: guild.members.cache.filter(m => !m.user.bot).size }) + " | " + message.translate("general/serverinfo:BOTS", { count: guild.members.cache.filter(m => m.user.bot).size }), true) + .addField(this.client.customEmojis.afk + message.translate("general/serverinfo:AFK_CHANNEL"), guild.afkChannel || message.translate("general/serverinfo:NO_AFK_CHANNEL"), true) + .addField(this.client.customEmojis.id + message.translate("common:ID"), guild.id, true) + .addField(this.client.customEmojis.crown + message.translate("common:OWNER"), guild.owner, true) + .addField(this.client.customEmojis.boost + message.translate("general/serverinfo:BOOSTS"), guild.premiumSubscriptionCount || 0, true) + .addField(this.client.customEmojis.channels + message.translate("common:CHANNELS"), message.translate("general/serverinfo:TEXT_CHANNELS", { count: guild.channels.cache.filter(c => c.type === "text").size }) + " | " + message.translate("general/serverinfo:VOICE_CHANNELS", { count: guild.channels.cache.filter(c => c.type === "voice").size }) + " | " + message.translate("general/serverinfo:CAT_CHANNELS", { count: guild.channels.cache.filter(c => c.type === "category").size }), true) .setColor(data.config.embed.color) .setFooter(data.config.embed.footer); diff --git a/commands/General/someone.js b/commands/General/someone.js index acc20a29..61bd7b4d 100644 --- a/commands/General/someone.js +++ b/commands/General/someone.js @@ -24,7 +24,7 @@ class Someone extends Command { .addField(message.translate("common:USERNAME"), member.user.username, true) .addField(message.translate("common:DISCRIMINATOR"), member.user.discriminator, true) .addField(message.translate("common:ID"), member.user.id, true) - .setThumbnail(member.user.displayAvatarURL({ size: 512, dynamic: true, format: 'png' })) + .setThumbnail(member.user.displayAvatarURL({ size: 512, dynamic: true, format: "png" })) .setColor(data.config.embed.color); message.channel.send(embed); } diff --git a/commands/General/stats.js b/commands/General/stats.js index d556d87e..f8398bcf 100644 --- a/commands/General/stats.js +++ b/commands/General/stats.js @@ -23,17 +23,17 @@ class Stats extends Command { .setFooter(data.config.embed.footer) .setAuthor(message.translate("common:STATS")) .setDescription(message.translate("general/stats:MADE")) - .addField(this.client.customEmojis.stats+" "+message.translate("general/stats:COUNTS_TITLE"), message.translate("general/stats:COUNTS_CONTENT", { servers: this.client.guilds.cache.size, users: this.client.users.cache.size }), true) - .addField(this.client.customEmojis.version+" "+message.translate("general/stats:VERSIONS_TITLE"), `\`Discord.js : v${Discord.version}\`\n\`Nodejs : v${process.versions.node}\``, true) - .addField(this.client.customEmojis.ram+" "+message.translate("general/stats:RAM_TITLE"), `\`${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2)}MB\``, true) - .addField(this.client.customEmojis.status.online+" "+message.translate("general/stats:ONLINE_TITLE"), message.translate("general/stats:ONLINE_CONTENT", { time: message.convertTime(Date.now()+this.client.uptime, "from", true) })) - .addField(this.client.customEmojis.voice+" "+message.translate("general/stats:MUSIC_TITLE"), message.translate("general/stats:MUSIC_CONTENT", { count: this.client.voice.connections.size })) + .addField(this.client.customEmojis.stats + " " + message.translate("general/stats:COUNTS_TITLE"), message.translate("general/stats:COUNTS_CONTENT", { servers: this.client.guilds.cache.size, users: this.client.users.cache.size }), true) + .addField(this.client.customEmojis.version + " " + message.translate("general/stats:VERSIONS_TITLE"), `\`Discord.js : v${Discord.version}\`\n\`Nodejs : v${process.versions.node}\``, true) + .addField(this.client.customEmojis.ram + " " + message.translate("general/stats:RAM_TITLE"), `\`${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2)}MB\``, true) + .addField(this.client.customEmojis.status.online + " " + message.translate("general/stats:ONLINE_TITLE"), message.translate("general/stats:ONLINE_CONTENT", { time: message.convertTime(Date.now()+this.client.uptime, "from", true) })) + .addField(this.client.customEmojis.voice + " " + message.translate("general/stats:MUSIC_TITLE"), message.translate("general/stats:MUSIC_CONTENT", { count: this.client.voice.connections.size })) .addField(message.translate("general/stats:CREDITS_TITLE"), message.translate("general/stats:CREDITS_CONTENT", { donators: [ ":(" ].join("\n"), translators: [ "`Jonny_Bro#4226` (:flag_ru:)", "`[ДАННЫЕ УДАЛЕНЫ]#2789` (:flag_ua:)", "`FaxoNfuckyou#9398` и `Jonny_Bro#4226` (:flag_us:)" ].join("\n") })); - statsEmbed.addField(this.client.customEmojis.link+" "+message.translate("general/stats:LINKS_TITLE"), message.translate("misc:STATS_FOOTER", { + statsEmbed.addField(this.client.customEmojis.link + " " + message.translate("general/stats:LINKS_TITLE"), message.translate("misc:STATS_FOOTER", { dashboardLink: "https://jaba.pp.ua", donateLink: "https://qiwi.com/n/JONNYBRO", owner: this.client.config.owner.id diff --git a/commands/General/suggest.js b/commands/General/suggest.js index 43664c8d..8a9666b4 100644 --- a/commands/General/suggest.js +++ b/commands/General/suggest.js @@ -25,10 +25,10 @@ class Suggest extends Command { if (!sugg) return message.error("general/suggest:MISSING_CONTENT"); const embed = new Discord.MessageEmbed() - .setAuthor(message.translate("general/suggest:TITLE", { user: message.author.username }), message.author.displayAvatarURL({ size: 512, dynamic: true, format: 'png' })) + .setAuthor(message.translate("general/suggest:TITLE", { user: message.author.username }), message.author.displayAvatarURL({ size: 512, dynamic: true, format: "png" })) .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:CONTENT"), "**"+sugg+"**") + .addField(message.translate("common:CONTENT"), sugg) .setColor(data.config.embed.color) .setFooter(data.config.embed.footer); diff --git a/commands/General/translate.js b/commands/General/translate.js index 85bc4ec0..ab2cb22a 100644 --- a/commands/General/translate.js +++ b/commands/General/translate.js @@ -22,7 +22,7 @@ class Translate extends Command { async run (message, args, data) { if (args[0] === "langs-list") { - const langsList = "```css\n"+(langs.map((l, i) => `#${i+1} - ${l}`).join("\n"))+"```"; + const langsList = "```css\n" + (langs.map((l, i) => `#${i+1} - ${l}`).join("\n")) + "```"; message.author.send(langsList).then(() => { message.success("general/translate:LIST_SENT"); }).catch(() => { @@ -47,9 +47,9 @@ class Translate extends Command { const translated = await translate(toTranslate, { to: language }); const resEmbed = new Discord.MessageEmbed() - .setAuthor("Translator", this.client.user.displayAvatarURL({ size: 512, dynamic: true, format: 'png' })) - .addField(translated.from.language.iso, "```"+toTranslate+"```") - .addField(language, "```"+translated.text+"```") + .setAuthor("Translator", this.client.user.displayAvatarURL({ size: 512, dynamic: true, format: "png" })) + .addField(translated.from.language.iso, "```" + toTranslate + "```") + .addField(language, "```" + translated.text + "```") .setColor(data.config.embed.color) .setFooter(data.config.embed.footer); diff --git a/commands/General/userinfo.js b/commands/General/userinfo.js index 22a11041..f1699a9f 100644 --- a/commands/General/userinfo.js +++ b/commands/General/userinfo.js @@ -41,43 +41,43 @@ class Userinfo extends Command { if (message.guild) member = await message.guild.members.fetch(user).catch(() => {}); const embed = new Discord.MessageEmbed() - .setAuthor(user.tag, user.displayAvatarURL({ size: 512, dynamic: true, format: 'png' })) + .setAuthor(user.tag, user.displayAvatarURL({ size: 512, dynamic: true, format: "png" })) .setThumbnail(user.displayAvatarURL({ dynamic: true })) - .addField(":man: "+message.translate("common:USERNAME"), user.username, true) - .addField(this.client.customEmojis.discriminator+" "+message.translate("common:DISCRIMINATOR"), user.discriminator, true) - .addField(this.client.customEmojis.bot+" "+message.translate("common:ROBOT"), (user.bot ? message.translate("common:YES") : message.translate("common:NO")), true) - .addField(this.client.customEmojis.calendar+" "+message.translate("common:CREATION"), message.printDate(user.createdAt), true) - .addField(this.client.customEmojis.avatar+" "+message.translate("common:AVATAR"), user.displayAvatarURL({ size: 512, dynamic: true, format: 'png' })) + .addField(":man: " + message.translate("common:USERNAME"), user.username, true) + .addField(this.client.customEmojis.discriminator + " " + message.translate("common:DISCRIMINATOR"), user.discriminator, true) + .addField(this.client.customEmojis.bot + " " + message.translate("common:ROBOT"), (user.bot ? message.translate("common:YES") : message.translate("common:NO")), true) + .addField(this.client.customEmojis.calendar + " " + message.translate("common:CREATION"), message.printDate(user.createdAt), true) + .addField(this.client.customEmojis.avatar + " " + message.translate("common:AVATAR"), user.displayAvatarURL({ size: 512, dynamic: true, format: "png" })) .setColor(data.config.embed.color) .setFooter(data.config.embed.footer); 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.status.online+" "+message.translate("common:STATUS"), message.translate("common:STATUS_"+(user.presence.status.toUpperCase())), true); + 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.status.online + " " + message.translate("common:STATUS"), message.translate("common:STATUS_" + (user.presence.status.toUpperCase())), true); }; if (member) { - embed.addField(this.client.customEmojis.up+" "+message.translate("common: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.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.roles+" "+message.translate("common:ROLES"), (member.roles.size > 10 ? member.roles.cache.map((r) => r).slice(0, 9).join(", ")+" "+message.translate("general/userinfo:MORE_ROLES", { count: member.roles.cache.size - 10 }) : (member.roles.cache.size < 1) ? message.translate("general/userinfo:NO_ROLE") : member.roles.cache.map((r) => r).join(", "))); + embed.addField(this.client.customEmojis.up + " " + message.translate("common: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.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.roles + " " + message.translate("common:ROLES"), (member.roles.size > 10 ? member.roles.cache.map((r) => r).slice(0, 9).join(", ") + " " + message.translate("general/userinfo:MORE_ROLES", { count: member.roles.cache.size - 10 }) : (member.roles.cache.size < 1) ? message.translate("general/userinfo:NO_ROLE") : member.roles.cache.map((r) => r).join(", "))); }; if (user.bot && this.client.config.apiKeys.dbl && (this.client.config.apiKeys.dbl !== "")) { - const res = await fetch("https://discordbots.org/api/bots/"+user.id, { + const res = await fetch("https://discordbots.org/api/bots/" + user.id, { headers: { "Authorization": this.client.config.apiKeys.dbl } }); const data = await res.json(); if (!data.error) { - embed.addField(this.client.customEmojis.desc+" "+message.translate("common:DESCRIPTION"), data.shortdesc, true) - .addField(this.client.customEmojis.stats+" "+message.translate("common:STATS"), message.translate("general/userinfo:BOT_STATS", { + embed.addField(this.client.customEmojis.desc + " " + message.translate("common:DESCRIPTION"), data.shortdesc, true) + .addField(this.client.customEmojis.stats + " " + message.translate("common:STATS"), message.translate("general/userinfo:BOT_STATS", { votes: data.monthlyPoints || 0, servers: data.server_count || 0, shards: (data.shards || [0]).length, lib: data.lib || "unknown" }), true) - .addField(this.client.customEmojis.link+" "+message.translate("common:LINKS"), `${data.support ? `[${message.translate("common:SUPPORT")}](${data.support}) | ` : ""}${data.invite ? `[${message.translate("common:INVITE")}](${data.invite}) | ` : ""}${data.github ? `[GitHub](${data.github}) | ` : ""}${data.website ? `[${message.translate("common:WEBSITE")}](${data.website})` : ""}`, true); + .addField(this.client.customEmojis.link + " " + message.translate("common:LINKS"), `${data.support ? `[${message.translate("common:SUPPORT")}](${data.support}) | ` : ""}${data.invite ? `[${message.translate("common:INVITE")}](${data.invite}) | ` : ""}${data.github ? `[GitHub](${data.github}) | ` : ""}${data.website ? `[${message.translate("common:WEBSITE")}](${data.website})` : ""}`, true); }; }; diff --git a/commands/Images/avatar.js b/commands/Images/avatar.js index abd9fb1f..b3e46dda 100644 --- a/commands/Images/avatar.js +++ b/commands/Images/avatar.js @@ -20,9 +20,10 @@ class Avatar extends Command { async run (message, args) { let user = await this.client.resolveUser(args[0]); if (!user) user = message.author; - const avatarURL = user.displayAvatarURL({ size: 512, dynamic: true, format: 'png' }); - if (message.content.includes("-v")) message.channel.send("<"+avatarURL+">"); + const avatarURL = user.displayAvatarURL({ size: 512, dynamic: true, format: "png" }); + if (message.content.includes("-v")) message.channel.send(`<${avatarURL}>`); const attachment = new Discord.MessageAttachment(avatarURL, `avatar.${avatarURL.split(".").pop().split("?")[0]}`); + message.channel.send(attachment); } }; diff --git a/commands/Moderation/checkinvites.js b/commands/Moderation/checkinvites.js index 7857119e..02a72525 100644 --- a/commands/Moderation/checkinvites.js +++ b/commands/Moderation/checkinvites.js @@ -28,12 +28,12 @@ class Checkinvites extends Command { withInvite.push({ id: m.user.id, tag: Discord.Util.escapeMarkdown(m.user.tag), - links: "**"+Discord.Util.escapeMarkdown(inviteLinks.join(", "))+"**" + links: "**" + Discord.Util.escapeMarkdown(inviteLinks.join(", ")) + "**" }); }; }); - const text = (withInvite.length > 0 ? withInvite.map((m) => "`"+m.id+"` ("+m.tag+") : "+m.links).join("\n") : message.translate("moderation/checkinvites:NOBODY")); + const text = (withInvite.length > 0 ? withInvite.map((m) => "`" + m.id + "` (" + m.tag + ") : " + m.links).join("\n") : message.translate("moderation/checkinvites:NOBODY")); const embed = new Discord.MessageEmbed() .setDescription(text) diff --git a/commands/Moderation/sanctions.js b/commands/Moderation/sanctions.js index a47bb4ff..2bb6e2ff 100644 --- a/commands/Moderation/sanctions.js +++ b/commands/Moderation/sanctions.js @@ -24,7 +24,7 @@ class Sanctions extends Command { const memberData = await this.client.findOrCreateMember({ id: user.id, guildID: message.guild.id }); const embed = new Discord.MessageEmbed() - .setAuthor(user.tag, user.displayAvatarURL({ size: 512, dynamic: true, format: 'png' })) + .setAuthor(user.tag, user.displayAvatarURL({ size: 512, dynamic: true, format: "png" })) .setColor(data.config.embed.color) .setFooter(data.config.embed.footer); @@ -33,7 +33,7 @@ class Sanctions extends Command { return message.channel.send(embed); } else { 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(embed); diff --git a/commands/Music/lyrics.js b/commands/Music/lyrics.js index 975df362..bbe19054 100644 --- a/commands/Music/lyrics.js +++ b/commands/Music/lyrics.js @@ -36,7 +36,7 @@ class Lyrics extends Command { let lyrics = await lyricsParse(songNameFormated, artistName) || "Не найдено!"; if (lyrics.length > 2040) { - lyrics = lyrics.substr(0, 2000) + message.translate("music/lyrics:AND_MORE") + " ["+message.translate("music/lyrics:CLICK_HERE")+"]"+`https://www.musixmatch.com/search/${songName}`; + lyrics = lyrics.substr(0, 2000) + message.translate("music/lyrics:AND_MORE") + " [" + message.translate("music/lyrics:CLICK_HERE") + "]" + `https://www.musixmatch.com/search/${songName}`; } else if (!lyrics.length) { return message.error("music/lyrics:NO_LYRICS_FOUND", { songName }); }; diff --git a/commands/Music/np.js b/commands/Music/np.js index 2b8384b4..c9f588f1 100644 --- a/commands/Music/np.js +++ b/commands/Music/np.js @@ -35,7 +35,7 @@ class Np extends Command { .addField(message.translate("music/np:T_TITLE"), track.title, true) .addField(message.translate("music/np:T_CHANNEL"), track.author, true) .addField(message.translate("music/np:T_DURATION"), message.convertTime(Date.now()+track.durationMS, "to", true), true) - .addField(message.translate("music/np:T_DESCRIPTION"), track.description ? (track.description.substring(0, 150)+"\n"+(message.translate("common:AND_MORE").toLowerCase())) : message.translate("music/np:NO_DESCRIPTION"), true) + .addField(message.translate("music/np:T_DESCRIPTION"), track.description ? (track.description.substring(0, 150) + "\n" + (message.translate("common:AND_MORE").toLowerCase())) : message.translate("music/np:NO_DESCRIPTION"), true) .addField("\u200B", this.client.player.createProgressBar(message, { timecodes: true })) .setTimestamp() .setColor(data.config.embed.color) diff --git a/commands/Owner/servers-list.js b/commands/Owner/servers-list.js index df48f2ab..5f8825df 100644 --- a/commands/Owner/servers-list.js +++ b/commands/Owner/servers-list.js @@ -31,7 +31,7 @@ class ServersList extends Command { .join("\n"); const embed = new Discord.MessageEmbed() - .setAuthor(message.author.tag, message.author.displayAvatarURL({ size: 512, dynamic: true, format: 'png' })) + .setAuthor(message.author.tag, message.author.displayAvatarURL({ size: 512, dynamic: true, format: "png" })) .setColor(data.config.embed.color) .setFooter(this.client.user.username) .setTitle(`${message.translate("common:PAGE")}: ${page}/${Math.ceil(this.client.guilds.cache.size/10)}`) diff --git a/dashboard/app.js b/dashboard/app.js index 7d84fbe3..145b2792 100644 --- a/dashboard/app.js +++ b/dashboard/app.js @@ -74,6 +74,6 @@ module.exports.load = async(client) => { // Listen app.listen(app.get("port"), () => { - console.log("JaBa Dashboard is listening on port "+app.get("port")); + console.log(`JaBa Dashboard is listening on port ${app.get("port")}`); }); }; \ No newline at end of file diff --git a/dashboard/routes/discord.js b/dashboard/routes/discord.js index 04c60ae8..9a86387b 100644 --- a/dashboard/routes/discord.js +++ b/dashboard/routes/discord.js @@ -7,7 +7,7 @@ const fetch = require("node-fetch"), // Gets login page router.get("/login", async function(req, res) { - if (!req.user || !req.user.id || !req.user.guilds) return res.redirect(`https://discordapp.com/api/oauth2/authorize?client_id=${req.client.user.id}&scope=identify%20guilds&response_type=code&redirect_uri=${encodeURIComponent(req.client.config.dashboard.baseURL+"/api/callback")}&state=${req.query.state || "no"}`); + if (!req.user || !req.user.id || !req.user.guilds) return res.redirect(`https://discordapp.com/api/oauth2/authorize?client_id=${req.client.user.id}&scope=identify%20guilds&response_type=code&redirect_uri=${encodeURIComponent(`${req.client.config.dashboard.baseURL}/api/callback`)}&state=${req.query.state || "no"}`); res.redirect("/selector"); }); @@ -19,7 +19,7 @@ router.get("/callback", async (req, res) => { const guildID = req.query.state.substr("invite".length, req.query.state.length); req.client.knownGuilds.push({ id: guildID, user: req.user.id }); - return res.redirect("/manage/"+guildID); + return res.redirect(`/manage/${guildID}`); }; }; diff --git a/dashboard/routes/guild-manager.js b/dashboard/routes/guild-manager.js index 18a37dc9..53908030 100644 --- a/dashboard/routes/guild-manager.js +++ b/dashboard/routes/guild-manager.js @@ -52,7 +52,7 @@ router.post("/:serverID", CheckAuth, async(req, res) => { const welcome = { enabled: true, message: data.message, - channel: guild.channels.cache.find((ch) => "#"+ch.name === data.channel).id, + channel: guild.channels.cache.find((ch) => "#" + ch.name === data.channel).id, withImage: data.withImage === "on" }; guildData.plugins.welcome = welcome; @@ -76,7 +76,7 @@ router.post("/:serverID", CheckAuth, async(req, res) => { const goodbye = { enabled: true, message: data.message, - channel: guild.channels.cache.find((ch) => "#"+ch.name === data.channel).id, + channel: guild.channels.cache.find((ch) => "#" + ch.name === data.channel).id, withImage: data.withImage === "on" }; guildData.plugins.goodbye = goodbye; @@ -99,7 +99,7 @@ router.post("/:serverID", CheckAuth, async(req, res) => { if (Object.prototype.hasOwnProperty.call(data, "autoroleEnable") || Object.prototype.hasOwnProperty.call(data, "autoroleUpdate")) { const autorole = { enabled: true, - role: guild.roles.cache.find((r) => "@"+r.name === data.role).id + role: guild.roles.cache.find((r) => "@" + r.name === data.role).id }; guildData.plugins.autorole = autorole; guildData.markModified("plugins.autorole"); @@ -118,20 +118,20 @@ router.post("/:serverID", CheckAuth, async(req, res) => { if (Object.prototype.hasOwnProperty.call(data, "suggestions")) { if (data.suggestions === req.translate("common:NO_CHANNEL")) guildData.plugins.suggestions = false; - else guildData.plugins.suggestions = guild.channels.cache.find((ch) => "#"+ch.name === data.suggestions).id; + else guildData.plugins.suggestions = guild.channels.cache.find((ch) => "#" + ch.name === data.suggestions).id; if (data.modlogs === req.translate("common:NO_CHANNEL")) guildData.plugins.modlogs = false; - else guildData.plugins.modlogs = guild.channels.cache.find((ch) => "#"+ch.name === data.modlogs).id; + else guildData.plugins.modlogs = guild.channels.cache.find((ch) => "#" + ch.name === data.modlogs).id; if (data.fortniteshop === req.translate("common:NO_CHANNEL")) guildData.plugins.fortniteshop = false; - else guildData.plugins.fortniteshop = guild.channels.cache.find((ch) => "#"+ch.name === data.fortniteshop).id; + else guildData.plugins.fortniteshop = guild.channels.cache.find((ch) => "#" + ch.name === data.fortniteshop).id; guildData.markModified("plugins"); }; await guildData.save(); - res.redirect(303, "/manage/"+guild.id); + res.redirect(303, `/manage/${guild.id}`); }); module.exports = router; \ No newline at end of file diff --git a/dashboard/views/404.ejs b/dashboard/views/404.ejs index 89ee5592..4693dacd 100644 --- a/dashboard/views/404.ejs +++ b/dashboard/views/404.ejs @@ -1,14 +1,14 @@ -<%- include('includes/head') %> +<%- include("includes/head") %>
<%= user.username %>
- <%= translate("common:STATUS_"+user.status.toUpperCase()) %> + class="fa fa-circle text-<%= user.status === "dnd" ? "danger" : user.status === "idle" ? "warning" : user.status === "online" ? "success" : ""%>"> + <%= translate("common:STATUS_" + user.status.toUpperCase()) %>