diff --git a/atlanta.js b/atlanta.js index fd573a4e4d..cda8452a9d 100644 --- a/atlanta.js +++ b/atlanta.js @@ -1,11 +1,10 @@ -require("./helpers/extenders"); - const Sentry = require("@sentry/node"), util = require("util"), fs = require("fs"), readdir = util.promisify(fs.readdir), mongoose = require("mongoose"), - chalk = require("chalk"); + chalk = require("chalk"), + synchronizeSlashCommands = require("discord-sync-commands"); const config = require("./config"); if(config.apiKeys.sentryDSN){ @@ -23,10 +22,13 @@ const Atlanta = require("./base/Atlanta"), const init = async () => { + const languages = require("./helpers/languages"); + client.translations = await languages(); + // Search for all commands const directories = await readdir("./commands/"); client.logger.log(`Loading a total of ${directories.length} categories.`, "log"); - directories.forEach(async (dir) => { + await Promise.all(directories.map(async (dir) => { const commands = await readdir("./commands/"+dir+"/"); commands.filter((cmd) => cmd.split(".").pop() === "js").forEach((cmd) => { const response = client.loadCommand("./commands/"+dir, cmd); @@ -34,6 +36,28 @@ const init = async () => { client.logger.log(response, "error"); } }); + })); + + const slashCommands = client.commands.filter((c) => c.conf.options); + synchronizeSlashCommands(client, slashCommands.map((command) => ({ + name: command.help.name, + type: "CHAT_INPUT", + description: client.translations.get("en-US")(`${command.help.category.toLowerCase()}/${command.help.name}:DESCRIPTION`), + options: command.conf.options.map((opt) => ({ + ...opt, + type: opt.type, + description: client.translations.get("en-US")(`${command.help.category.toLowerCase()}/${command.help.name}:OPT_${opt.name.toUpperCase()}_DESCRIPTION`), + options: opt.options?.map((o) => ({ + ...o, + type: opt.type, + description: client.translations.get("en-US")(`${command.help.category.toLowerCase()}/${command.help.name}:OPT_${o.name.toUpperCase()}_DESCRIPTION`) + }) + ) + }) + ) + })), { + debug: true, + guildId: config.support.id }); // Then we load events, which will include our message and ready event. @@ -55,9 +79,6 @@ const init = async () => { }).catch((err) => { client.logger.log("Unable to connect to the Mongodb database. Error:"+err, "error"); }); - - const languages = require("./helpers/languages"); - client.translations = await languages(); const autoUpdateDocs = require("./helpers/autoUpdateDocs.js"); autoUpdateDocs.update(client); diff --git a/base/Atlanta.js b/base/Atlanta.js index 1788ac3214..19368cba87 100644 --- a/base/Atlanta.js +++ b/base/Atlanta.js @@ -36,7 +36,6 @@ class Atlanta extends Client { this.customEmojis = require("../emojis.json"); // load the bot's emojis this.languages = require("../languages/language-meta.json"); // Load the bot's languages this.commands = new Collection(); // Creates new commands collection - this.aliases = new Collection(); // Creates new command aliases collection this.logger = require("../helpers/logger"); // Load the logger file this.wait = util.promisify(setTimeout); // client.wait(1000) - Wait 1 second this.functions = require("../helpers/functions"); // Load the functions file @@ -201,9 +200,6 @@ class Atlanta extends Client { props.init(this); } this.commands.set(props.help.name, props); - props.help.aliases.forEach((alias) => { - this.aliases.set(alias, props.help.name); - }); return false; } catch (e) { return `Unable to load command ${commandName}: ${e}`; diff --git a/base/Command.js b/base/Command.js index 3ee4b85c80..162a40170d 100644 --- a/base/Command.js +++ b/base/Command.js @@ -6,17 +6,16 @@ module.exports = class Command { dirname = false, enabled = true, guildOnly = false, - aliases = new Array(), botPermissions = new Array(), memberPermissions = new Array(), nsfw = false, ownerOnly = false, - cooldown = 3000 + options = null }) { const category = (dirname ? dirname.split(path.sep)[parseInt(dirname.split(path.sep).length-1, 10)] : "Other"); this.client = client; - this.conf = { enabled, guildOnly, memberPermissions, botPermissions, nsfw, ownerOnly, cooldown}; - this.help = { name, category, aliases }; + this.conf = { enabled, guildOnly, memberPermissions, botPermissions, nsfw, ownerOnly, options }; + this.help = { name, category }; } }; diff --git a/base/Log.js b/base/Log.js index 5e9d898e90..8a89f1c7d8 100644 --- a/base/Log.js +++ b/base/Log.js @@ -14,4 +14,4 @@ module.exports = mongoose.model("Log", new mongoose.Schema({ id: null }} -})); \ No newline at end of file +})); diff --git a/base/Member.js b/base/Member.js index 1ad6c81661..10d8c6937c 100644 --- a/base/Member.js +++ b/base/Member.js @@ -30,4 +30,4 @@ module.exports = mongoose.model("Member", new mongoose.Schema({ endDate: null }}, -})); \ No newline at end of file +})); diff --git a/base/User.js b/base/User.js index c3d0a6bd98..b42dd3cc15 100644 --- a/base/User.js +++ b/base/User.js @@ -116,4 +116,4 @@ userSchema.method("getAchievements", async function(){ return canvas.toBuffer(); }); -module.exports = mongoose.model("User", userSchema); \ No newline at end of file +module.exports = mongoose.model("User", userSchema); diff --git a/commands/Administration/addcommand.js b/commands/Administration/addcommand.js index 323ce3e3cb..c0a2648071 100644 --- a/commands/Administration/addcommand.js +++ b/commands/Administration/addcommand.js @@ -1,6 +1,6 @@ const Command = require("../../base/Command.js"); -class Addcommand extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -8,7 +8,7 @@ class Addcommand extends Command { dirname: __dirname, enabled: true, guildOnly: true, - aliases: [ "custom-command" ], + memberPermissions: [ "MANAGE_GUILD" ], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -17,17 +17,20 @@ class Addcommand extends Command { }); } - async run (message, args, data) { + async run (interaction, translate, data) { if (!args[0]) - return message.error("administration/addcommand:MISSING_NAME"); + return interaction.reply({ + content: translate("administration/addcommand:MISSING_NAME"), + ephemeral: true + }); const name = args[0].split("\n")[0]; if ( this.client.commands.get(name) || this.client.aliases.get(name) || - data.guild.customCommands.find((c) => c.name === name) + data.guildData.customCommands.find((c) => c.name === name) ) { return message.error( "administration/addcommand:COMMAND_ALREADY_EXISTS" @@ -36,21 +39,22 @@ class Addcommand extends Command { const answer = (args[0].split("\n")[1] || "") + args.slice(1).join(" "); if (!answer) { - return message.error("administration/addcommand:MISSING_ANSWER"); + return interaction.reply({ + content: translate("administration/addcommand:MISSING_ANSWER"), + ephemeral: true + }); } - data.guild.customCommands.push({ + data.guildData.customCommands.push({ name: name.toLowerCase(), answer: answer }); - data.guild.save(); + data.guildData.save(); message.success("administration/addcommand:SUCCESS", { commandName: name, - prefix: data.guild.prefix + prefix: data.guildData.prefix }); } -} - -module.exports = Addcommand; +}; diff --git a/commands/Administration/addemoji.js b/commands/Administration/addemoji.js index 64eac555f9..d16bac87c6 100644 --- a/commands/Administration/addemoji.js +++ b/commands/Administration/addemoji.js @@ -1,6 +1,6 @@ const Command = require("../../base/Command.js"); -class Addemoji extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -8,7 +8,7 @@ class Addemoji extends Command { dirname: __dirname, enabled: true, guildOnly: true, - aliases: [], + , memberPermissions: [ "MANAGE_GUILD" ], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -17,19 +17,28 @@ class Addemoji extends Command { }); } - async run (message, args) { + async run (interaction, translate) { const URL = args[0]; if (!URL) { - return message.error("administration/addemoji:MISSING_URL"); + return interaction.reply({ + content: translate("administration/addemoji:MISSING_URL"), + ephemeral: true + }); } const name = args[1] ? args[1].replace(/[^a-z0-9]/gi, "") : null; if (!name) { - return message.error("administration/addemoji:MISSING_NAME"); + return interaction.reply({ + content: translate("administration/addemoji:MISSING_NAME"), + ephemeral: true + }); } if (name.length < 2 || name > 32) { - return message.error("administration/addemoji:INVALID_NAME"); + return interaction.reply({ + content: translate("administration/addemoji:INVALID_NAME"), + ephemeral: true + }); } message.guild.emojis @@ -46,6 +55,4 @@ class Addemoji extends Command { }); } -} - -module.exports = Addemoji; \ No newline at end of file +}; diff --git a/commands/Administration/automod.js b/commands/Administration/automod.js index 7d266b28d9..77acccc71d 100644 --- a/commands/Administration/automod.js +++ b/commands/Administration/automod.js @@ -1,6 +1,6 @@ const Command = require("../../base/Command.js"); -class Automod extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -8,7 +8,7 @@ class Automod extends Command { dirname: __dirname, enabled: true, guildOnly: true, - aliases: [], + , memberPermissions: [ "MANAGE_GUILD" ], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -17,38 +17,41 @@ class Automod extends Command { }); } - async run (message, args,data) { + async run (interaction, translate,data) { const status = args[0]; if(!status || (status !== "on" && status !== "off")){ - return message.error("administration/automod:MISSING_STATUS"); + return interaction.reply({ + content: translate("administration/automod:MISSING_STATUS"), + ephemeral: true + }); } if(status === "on"){ - data.guild.plugins.automod = { enabled: true, ignored: [] }; - data.guild.markModified("plugins.automod"); - data.guild.save(); + data.guildData.plugins.automod = { enabled: true, ignored: [] }; + data.guildData.markModified("plugins.automod"); + data.guildData.save(); message.success("administration/automod:ENABLED", { - prefix: data.guild.prefix + prefix: data.guildData.prefix }); } else if (status === "off"){ - if(message.mentions.channels.filter((ch) => ch.type === "text" && ch.guild.id === message.guild.id).first()){ + if(message.mentions.channels.filter((ch) => ch.type === "text" && ch.guild.id === interaction.guild.id).first()){ const channel = message.mentions.channels.first(); - data.guild.plugins.automod.ignored.push(channel); - data.guild.markModified("plugins.automod"); - data.guild.save(); + data.guildData.plugins.automod.ignored.push(channel); + data.guildData.markModified("plugins.automod"); + data.guildData.save(); message.success("administration/automod:DISABLED_CHANNEL", { channel: channel.toString() }); } else { - data.guild.plugins.automod = { enabled: false, ignored: [] }; - data.guild.markModified("plugins.automod"); - data.guild.save(); - message.success("administration/automod:DISABLED"); + data.guildData.plugins.automod = { enabled: false, ignored: [] }; + data.guildData.markModified("plugins.automod"); + data.guildData.save(); + interaction.reply({ + content: translate("administration/automod:DISABLED") + }); } } } -} - -module.exports = Automod; \ No newline at end of file +}; diff --git a/commands/Administration/autorole.js b/commands/Administration/autorole.js index 5eeba56c41..d23eec17c2 100644 --- a/commands/Administration/autorole.js +++ b/commands/Administration/autorole.js @@ -1,7 +1,7 @@ const Command = require("../../base/Command.js"), Resolvers = require("../../helpers/resolvers"); -class Autorole extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -9,7 +9,7 @@ class Autorole extends Command { dirname: __dirname, enabled: true, guildOnly: true, - aliases: [ "ar" ], + memberPermissions: [ "MANAGE_GUILD" ], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -18,11 +18,14 @@ class Autorole extends Command { }); } - async run (message, args, data) { + async run (interaction, translate, data) { const status = args[0]; if(status !== "on" && status !== "off"){ - return message.error("administration/autorole:MISSING_STATUS"); + return interaction.reply({ + content: translate("administration/autorole:MISSING_STATUS"), + ephemeral: true + }); } if(status === "on"){ @@ -32,15 +35,18 @@ class Autorole extends Command { search: args.slice(1).join(" ") }); if(!role){ - return message.error("administration/autorole:MISSING_ROLE"); + return interaction.reply({ + content: translate("administration/autorole:MISSING_ROLE"), + ephemeral: true + }); } - data.guild.plugins.autorole = { + data.guildData.plugins.autorole = { enabled: true, role: role.id }; - data.guild.markModified("plugins.autorole"); - await data.guild.save(); + data.guildData.markModified("plugins.autorole"); + await data.guildData.save(); message.success("administration/autorole:SUCCESS_ENABLED", { roleName: role.name @@ -49,27 +55,25 @@ class Autorole extends Command { if(status === "off"){ - if(!data.guild.plugins.autorole.enabled){ + if(!data.guildData.plugins.autorole.enabled){ return message.success("administration/autorole:ALREADY_DISABLED", { - prefix: data.guild.prefix + prefix: data.guildData.prefix }); } - data.guild.plugins.autorole = { + data.guildData.plugins.autorole = { enabled: false, role: null }; - data.guild.markModified("plugins.autorole"); - await data.guild.save(); + data.guildData.markModified("plugins.autorole"); + await data.guildData.save(); message.success("administration/autorole:SUCCESS_DISABLED", { - prefix: data.guild.prefix + prefix: data.guildData.prefix }); } } -} - -module.exports = Autorole; \ No newline at end of file +}; diff --git a/commands/Administration/backup.js b/commands/Administration/backup.js index fe62b0ecee..45c80da53e 100644 --- a/commands/Administration/backup.js +++ b/commands/Administration/backup.js @@ -3,7 +3,7 @@ const Command = require("../../base/Command.js"), backup = require("discord-backup"), Sentry = require("@sentry/node"); -class Backup extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -11,7 +11,7 @@ class Backup extends Command { dirname: __dirname, enabled: true, guildOnly: true, - aliases: [ "sauvegarde" ], + memberPermissions: [ "MANAGE_GUILD" ], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "ADMINISTRATOR" ], nsfw: false, @@ -20,11 +20,14 @@ class Backup extends Command { }); } - async run (message, args, data) { + async run (interaction, translate, data) { const status = args[0]; if(!status){ - return message.error("administration/backup:MISSING_STATUS"); + return interaction.reply({ + content: translate("administration/backup:MISSING_STATUS"), + ephemeral: true + }); } if(status === "create"){ @@ -33,43 +36,62 @@ class Backup extends Command { }); backup.create(message.guild).then((backup) => { m.delete(); - message.success("administration/backup:SUCCESS_PUBLIC"); - message.author.send(message.translate("administration/backup:SUCCESS_PRIVATE", { + interaction.reply({ + content: translate("administration/backup:SUCCESS_PUBLIC") + }); + interaction.user.send(translate("administration/backup:SUCCESS_PRIVATE", { backupID: backup.id })).catch(() => { backup.remove(backup.id); - message.error("misc:CANNOT_DM"); + interaction.reply({ + content: translate("misc:CANNOT_DM"), + ephemeral: true + }); }); }).catch((err) => { Sentry.captureException(err); - return message.error("misc:ERR_OCCURRED"); + return interaction.reply({ + content: translate("misc:ERR_OCCURRED"), + ephemeral: true + }); }); } else if (status === "load"){ const backupID = args[1]; if(!backupID){ - return message.error("administration/backup:MISSING_BACKUP_ID"); + return interaction.reply({ + content: translate("administration/backup:MISSING_BACKUP_ID"), + ephemeral: true + }); } backup.fetch(backupID).then(async () => { - message.sendT("administration/backup:CONFIRMATION"); - await message.channel.awaitMessages(m => (m.author.id === message.author.id) && (m.content === "-confirm"), { + interaction.reply({ + content: translate("administration/backup:CONFIRMATION") + }); + await message.channel.awaitMessages(m => (m.author.id === interaction.user.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"); + return interaction.reply({ + content: translate("administration/backup:TIMES_UP"), + ephemeral: true + }); }); // When the author of the command has confirmed that he wants to load the backup on his server - message.author.send(message.translate("administration/backup:START_LOADING")); + interaction.user.send(translate("administration/backup:START_LOADING")); // Load the backup backup.load(backupID, message.guild).then(() => { // When the backup is loaded, delete them from the server backup.remove(backupID); - message.author.send(message.translate("administration/backup:LOAD_SUCCESS")); + interaction.user.send(translate("administration/backup:LOAD_SUCCESS")); }).catch((err) => { Sentry.captureException(err); // If an error occurenced - return message.error("misc:ERR_OCCURRED"); + return interaction.reply({ + content: translate("misc:ERR_OCCURRED"), + ephemeral: true + }); }); }).catch(() => { // if the backup wasn't found @@ -80,19 +102,22 @@ class Backup extends Command { } else if (status === "info"){ const backupID = args[1]; if(!backupID){ - return message.error("administration/backup:MISSING_BACKUP_ID"); + return interaction.reply({ + content: translate("administration/backup:MISSING_BACKUP_ID"), + ephemeral: true + }); } backup.fetch(backupID).then(async (backupInfos) => { const embed = new Discord.MessageEmbed() - .setAuthor(message.translate("administration/backup:TITLE_INFOS")) + .setAuthor(translate("administration/backup:TITLE_INFOS")) // Display the backup ID - .addField(message.translate("administration/backup:TITLE_ID"), backupInfos.id, true) + .addField(translate("administration/backup:TITLE_ID"), backupInfos.id, true) // Displays the server from which this backup comes - .addField(message.translate("administration/backup:TITLE_SERVER_ID"), backupInfos.data.guildID, true) + .addField(translate("administration/backup:TITLE_SERVER_ID"), backupInfos.data.guildID, true) // Display the size (in mb) of the backup - .addField(message.translate("administration/backup:TITLE_SIZE"), backupInfos.size+" mb", true) + .addField(translate("administration/backup:TITLE_SIZE"), backupInfos.size+" mb", true) // Display when the backup was created - .addField(message.translate("administration/backup:TITLE_CREATED_AT"), message.printDate(new Date(backupInfos.data.createdTimestamp)), true) + .addField(translate("administration/backup:TITLE_CREATED_AT"), message.printDate(new Date(backupInfos.data.createdTimestamp)), true) .setColor(data.config.embed.color) .setFooter(data.config.embed.footer); message.channel.send({ embeds: [embed] }); @@ -103,11 +128,12 @@ class Backup extends Command { }); }); } else { - return message.error("administration/backup:MISSING_STATUS"); + return interaction.reply({ + content: translate("administration/backup:MISSING_STATUS"), + ephemeral: true + }); } } -} - -module.exports = Backup; \ No newline at end of file +}; diff --git a/commands/Administration/configuration.js b/commands/Administration/configuration.js index 7bca29320b..1546b497b4 100644 --- a/commands/Administration/configuration.js +++ b/commands/Administration/configuration.js @@ -1,7 +1,7 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"); -class Configuration extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -9,7 +9,7 @@ class Configuration extends Command { dirname: __dirname, enabled: true, guildOnly: true, - aliases: [ "conf", "config" ], + memberPermissions: [ "MANAGE_GUILD" ], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -18,9 +18,9 @@ class Configuration extends Command { }); } - async run (message, args, data) { + async run (interaction, translate, data) { - const guildData = data.guild; + const guildData = data.guildData; const embed = new Discord.MessageEmbed() .setAuthor(message.guild.name, message.guild.iconURL()) @@ -28,104 +28,102 @@ class Configuration extends Command { .setFooter(this.client.config.embed.footer); // Guild prefix - embed.addField(message.translate("administration/configuration:PREFIX_TITLE"), guildData.prefix); + embed.addField(translate("administration/configuration:PREFIX_TITLE"), guildData.prefix); // Ignored channels - embed.addField(message.translate("administration/configuration:IGNORED_CHANNELS_TITLE"), + embed.addField(translate("administration/configuration:IGNORED_CHANNELS_TITLE"), (guildData.ignoredChannels.length > 0) ? guildData.ignoredChannels.map((ch) => `<#${ch}>`).join(", ") - : message.translate("administration/configuration:NO_IGNORED_CHANNELS") + : translate("administration/configuration:NO_IGNORED_CHANNELS") ); // Autorole plugin - embed.addField(message.translate("administration/configuration:AUTOROLE_TITLE"), + embed.addField(translate("administration/configuration:AUTOROLE_TITLE"), (guildData.plugins.autorole.enabled) ? - message.translate("administration/configuration:AUTOROLE_CONTENT", { + translate("administration/configuration:AUTOROLE_CONTENT", { roleName: `<@&${guildData.plugins.autorole.role}>` }) - : message.translate("administration/configuration:AUTOROLE_DISABLED") + : translate("administration/configuration:AUTOROLE_DISABLED") ); // Welcome plugin - embed.addField(message.translate("administration/configuration:WELCOME_TITLE"), + embed.addField(translate("administration/configuration:WELCOME_TITLE"), (guildData.plugins.welcome.enabled) ? - message.translate("administration/configuration:WELCOME_CONTENT", { + translate("administration/configuration:WELCOME_CONTENT", { channel: `<#${guildData.plugins.welcome.channel}>`, - withImage: guildData.plugins.welcome.withImage ? message.translate("common:YES") : message.translate("common:NO") + withImage: guildData.plugins.welcome.withImage ? translate("common:YES") : translate("common:NO") }) - : message.translate("administration/configuration:WELCOME_DISABLED") + : translate("administration/configuration:WELCOME_DISABLED") ); // Goodbye plugin - embed.addField(message.translate("administration/configuration:GOODBYE_TITLE"), + embed.addField(translate("administration/configuration:GOODBYE_TITLE"), (guildData.plugins.goodbye.enabled) ? - message.translate("administration/configuration:GOODBYE_CONTENT", { + translate("administration/configuration:GOODBYE_CONTENT", { channel: `<#${guildData.plugins.goodbye.channelID}>`, - withImage: guildData.plugins.goodbye.withImage ? message.translate("common:YES") : message.translate("common:NO") + withImage: guildData.plugins.goodbye.withImage ? translate("common:YES") : translate("common:NO") }) - : message.translate("administration/configuration:GOODBYE_DISABLED") + : translate("administration/configuration:GOODBYE_DISABLED") ); // Special channels - embed.addField(message.translate("administration/configuration:SPECIAL_CHANNELS"), - message.translate("administration/configuration:MODLOGS", { + embed.addField(translate("administration/configuration:SPECIAL_CHANNELS"), + translate("administration/configuration:MODLOGS", { channel: guildData.plugins.modlogs ? `<#${guildData.plugins.modlogs}>` - : message.translate("common:NOT_DEFINED") + : translate("common:NOT_DEFINED") }) + "\n" + - message.translate("administration/configuration:FORTNITESHOP", { + translate("administration/configuration:FORTNITESHOP", { channel: guildData.plugins.fortniteshop ? `<#${guildData.plugins.fortniteshop}>` - : message.translate("common:NOT_DEFINED") + : translate("common:NOT_DEFINED") }) + "\n" + - message.translate("administration/configuration:SUGGESTIONS", { + translate("administration/configuration:SUGGESTIONS", { channel: guildData.plugins.suggestions ? `<#${guildData.plugins.suggestions}>` - : message.translate("common:NOT_DEFINED") + : translate("common:NOT_DEFINED") }) + "\n" + - message.translate("administration/configuration:REPORTS", { + translate("administration/configuration:REPORTS", { channel: guildData.plugins.reports ? `<#${guildData.plugins.reports}>` - : message.translate("common:NOT_DEFINED") + : translate("common:NOT_DEFINED") }) ); // Auto sanctions - embed.addField(message.translate("administration/configuration:AUTO_SANCTIONS"), + embed.addField(translate("administration/configuration:AUTO_SANCTIONS"), ((guildData.plugins.warnsSanctions.kick) ? - message.translate("administration/configuration:KICK_CONTENT", { + translate("administration/configuration:KICK_CONTENT", { count: guildData.plugins.warnsSanctions.kick }) - : message.translate("administration/configuration:KICK_NOT_DEFINED")) + "\n" + + : translate("administration/configuration:KICK_NOT_DEFINED")) + "\n" + ((guildData.plugins.warnsSanctions.ban) ? - message.translate("administration/configuration:BAN_CONTENT", { + translate("administration/configuration:BAN_CONTENT", { count: guildData.plugins.warnsSanctions.ban }) - : message.translate("administration/configuration:BAN_NOT_DEFINED")) + : translate("administration/configuration:BAN_NOT_DEFINED")) ); // Automod plugin - embed.addField(message.translate("administration/configuration:AUTOMOD_TITLE"), + embed.addField(translate("administration/configuration:AUTOMOD_TITLE"), (guildData.plugins.automod.enabled) ? - message.translate("administration/configuration:AUTOMOD_CONTENT", { + translate("administration/configuration:AUTOMOD_CONTENT", { channels: guildData.plugins.automod.ignored.map((ch) => `<#${ch}>`) }) - : message.translate("administration/configuration:AUTOMOD_DISABLED") + : translate("administration/configuration:AUTOMOD_DISABLED") ); // Auto-delete mod commands - embed.addField(message.translate("administration/configuration:AUTODELETEMOD"), + embed.addField(translate("administration/configuration:AUTODELETEMOD"), (!message.guild.autoDeleteModCommands) ? - message.translate("administration/configuration:AUTODELETEMOD_ENABLED") - : message.translate("administration/configuration:AUTODELETEMOD_DISABLED") + translate("administration/configuration:AUTODELETEMOD_ENABLED") + : translate("administration/configuration:AUTODELETEMOD_DISABLED") ); // Dashboard link - embed.addField(message.translate("administration/configuration:DASHBOARD_TITLE"), `[${message.translate("administration/configuration:DASHBOARD_CONTENT")}](${this.client.config.supportURL})`); + embed.addField(translate("administration/configuration:DASHBOARD_TITLE"), `[${translate("administration/configuration:DASHBOARD_CONTENT")}](${this.client.config.supportURL})`); message.channel.send({ embeds: [embed] }); } -} - -module.exports = Configuration; +}; diff --git a/commands/Administration/delcommand.js b/commands/Administration/delcommand.js index c881d49958..5a0aa7946f 100644 --- a/commands/Administration/delcommand.js +++ b/commands/Administration/delcommand.js @@ -1,6 +1,6 @@ const Command = require("../../base/Command.js"); -class Delcommand extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -8,7 +8,7 @@ class Delcommand extends Command { dirname: __dirname, enabled: true, guildOnly: true, - aliases: [], + , memberPermissions: [ "MANAGE_GUILD" ], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -17,27 +17,28 @@ class Delcommand extends Command { }); } - async run (message, args, data) { + async run (interaction, translate, data) { const name = args[0]; if(!name){ - return message.error("administration/delcommand:MISSING_NAME"); + return interaction.reply({ + content: translate("administration/delcommand:MISSING_NAME"), + ephemeral: true + }); } - if(!data.guild.customCommands.find((c) => c.name === name)){ + if(!data.guildData.customCommands.find((c) => c.name === name)){ return message.error("administration/delcommand:UNKNOWN_COMMAND", { commandName: name }); } - data.guild.customCommands = data.guild.customCommands.filter((c) => c.name !== name); - data.guild.save(); + data.guildData.customCommands = data.guildData.customCommands.filter((c) => c.name !== name); + data.guildData.save(); message.success("administration/delcommand:SUCCESS", { commandName: name }); } -} - -module.exports = Delcommand; \ No newline at end of file +}; diff --git a/commands/Administration/deletemod.js b/commands/Administration/deletemod.js index 137c8a7299..1f149017a5 100644 --- a/commands/Administration/deletemod.js +++ b/commands/Administration/deletemod.js @@ -1,6 +1,6 @@ const Command = require("../../base/Command.js"); -class Deletemod extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -8,7 +8,7 @@ class Deletemod extends Command { dirname: __dirname, enabled: true, guildOnly: true, - aliases: [ "autodeletemodcommands" ], + memberPermissions: [ "MANAGE_MESSAGES" ], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -17,22 +17,27 @@ class Deletemod extends Command { }); } - async run (message, args, data) { + async run (interaction, translate, data) { const status = args[0]; if(!status || status !== "on" && status !== "off"){ - return message.error("administration/deletemod:MISSING_STATUS"); + return interaction.reply({ + content: translate("administration/deletemod:MISSING_STATUS"), + ephemeral: true + }); } if(status === "on"){ - data.guild.autoDeleteModCommands = true; - data.guild.save(); - message.success("administration/deletemod:ENABLED"); + data.guildData.autoDeleteModCommands = true; + data.guildData.save(); + interaction.reply({ + content: translate("administration/deletemod:ENABLED") + }); } else { - data.guild.autoDeleteModCommands = false; - data.guild.save(); - message.success("administration/deletemod:DISABLED"); + data.guildData.autoDeleteModCommands = false; + data.guildData.save(); + interaction.reply({ + content: translate("administration/deletemod:DISABLED") + }); } } -} - -module.exports = Deletemod; \ No newline at end of file +}; diff --git a/commands/Administration/goodbye.js b/commands/Administration/goodbye.js index 51ba9071c2..f225fc6755 100644 --- a/commands/Administration/goodbye.js +++ b/commands/Administration/goodbye.js @@ -1,7 +1,7 @@ const Command = require("../../base/Command.js"), Resolvers = require("../../helpers/resolvers"); -class Goodbye extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -9,7 +9,7 @@ class Goodbye extends Command { dirname: __dirname, enabled: true, guildOnly: true, - aliases: [ "au-revoir" ], + memberPermissions: [ "MANAGE_GUILD" ], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -18,33 +18,38 @@ class Goodbye extends Command { }); } - async run (message, args, data) { + async run (interaction, translate, data) { if ( args[0] === "test" && - data.guild.plugins.goodbye.enabled + data.guildData.plugins.goodbye.enabled ) { this.client.emit("guildMemberRemove", message.member); - return message.success("administration/goodbye:TEST_SUCCESS"); + return interaction.reply({ + content: translate("administration/goodbye:TEST_SUCCESS") + }); } if ( (!args[0] || !["edit", "off"].includes(args[0])) && - data.guild.plugins.goodbye.enabled + data.guildData.plugins.goodbye.enabled ) - return message.error("administration/goodbye:MISSING_STATUS"); + return interaction.reply({ + content: translate("administration/goodbye:MISSING_STATUS"), + ephemeral: true + }); if (args[0] === "off") { - data.guild.plugins.goodbye = { + data.guildData.plugins.goodbye = { enabled: false, message: null, channelID: null, withImage: null }; - data.guild.markModified("plugins.goodbye"); - data.guild.save(); + data.guildData.markModified("plugins.goodbye"); + data.guildData.save(); return message.error("administration/goodbye:DISABLED", { - prefix: data.guild.prefix + prefix: data.guildData.prefix }); } else { const goodbye = { @@ -55,10 +60,10 @@ class Goodbye extends Command { }; message.sendT("administration/goodbye:FORM_1", { - author: message.author.toString() + author: interaction.user.toString() }); const collector = message.channel.createMessageCollector( - m => m.author.id === message.author.id, + m => m.author.id === interaction.user.id, { time: 120000 // 2 minutes } @@ -69,22 +74,25 @@ class Goodbye extends Command { if (goodbye.message) { if ( msg.content.toLowerCase() === - message.translate("common:YES").toLowerCase() + translate("common:YES").toLowerCase() ) { goodbye.withImage = true; } else if ( msg.content.toLowerCase() === - message.translate("common:NO").toLowerCase() + translate("common:NO").toLowerCase() ) { goodbye.withImage = false; } else { - return message.error("misc:INVALID_YES_NO"); + return interaction.reply({ + content: translate("misc:INVALID_YES_NO"), + ephemeral: true + }); } - data.guild.plugins.goodbye = goodbye; - data.guild.markModified("plugins.goodbye"); - await data.guild.save(); + data.guildData.plugins.goodbye = goodbye; + data.guildData.markModified("plugins.goodbye"); + await data.guildData.save(); message.sendT("administration/goodbye:FORM_SUCCESS", { - prefix: data.guild.prefix, + prefix: data.guildData.prefix, channel: `<#${goodbye.channel}>` }); return collector.stop(); @@ -94,9 +102,14 @@ class Goodbye extends Command { if (goodbye.channel && !goodbye.message) { if (msg.content.length < 1800) { goodbye.message = msg.content; - return message.sendT("administration/goodbye:FORM_3"); + return interaction.reply({ + content: translate("administration/goodbye:FORM_3") + }); } - return message.error("administration/goodbye:MAX_CHARACT"); + return interaction.reply({ + content: translate("administration/goodbye:MAX_CHARACT"), + ephemeral: true + }); } // If the channel is not filled, it means the user sent it @@ -106,7 +119,10 @@ class Goodbye extends Command { channelType: "text" }); if (!channel) { - return message.error("misc:INVALID_CHANNEL"); + return interaction.reply({ + content: translate("misc:INVALID_CHANNEL"), + ephemeral: true + }); } goodbye.channel = channel.id; message.sendT("administration/goodbye:FORM_2", { @@ -119,12 +135,13 @@ class Goodbye extends Command { collector.on("end", (_, reason) => { if (reason === "time") { - return message.error("misc:TIMEOUT"); + return interaction.reply({ + content: translate("misc:TIMEOUT"), + ephemeral: true + }); } }); } } -} - -module.exports = Goodbye; +}; diff --git a/commands/Administration/ignore.js b/commands/Administration/ignore.js index 4fd4f8499c..5b6a8db6af 100644 --- a/commands/Administration/ignore.js +++ b/commands/Administration/ignore.js @@ -1,6 +1,6 @@ const Command = require("../../base/Command.js"); -class Ignore extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -8,7 +8,7 @@ class Ignore extends Command { dirname: __dirname, enabled: true, guildOnly: true, - aliases: [ "disableChannel" ], + memberPermissions: [ "MANAGE_GUILD" ], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -17,24 +17,27 @@ class Ignore extends Command { }); } - async run (message, args, data) { + async run (interaction, translate, data) { - const channel = message.mentions.channels.filter((ch) => ch.type === "text" && ch.guild.id === message.guild.id).first(); + const channel = message.mentions.channels.filter((ch) => ch.type === "text" && ch.guild.id === interaction.guild.id).first(); if(!channel){ - return message.error("misc:INVALID_CHANNEL"); + return interaction.reply({ + content: translate("misc:INVALID_CHANNEL"), + ephemeral: true + }); } - const ignored = data.guild.ignoredChannels.includes(channel.id); + const ignored = data.guildData.ignoredChannels.includes(channel.id); if(ignored){ - data.guild.ignoredChannels = data.guild.ignoredChannels.filter((ch) => ch !== channel.id); - data.guild.save(); + data.guildData.ignoredChannels = data.guildData.ignoredChannels.filter((ch) => ch !== channel.id); + data.guildData.save(); return message.success("administration/ignore:ALLOWED", { channel: channel.toString() }); } else if(!ignored){ - data.guild.ignoredChannels.push(channel.id); - data.guild.save(); + data.guildData.ignoredChannels.push(channel.id); + data.guildData.save(); return message.success("administration/ignore:IGNORED", { channel: channel.toString() }); @@ -42,6 +45,4 @@ class Ignore extends Command { } -} - -module.exports = Ignore; \ No newline at end of file +}; diff --git a/commands/Administration/setfortniteshop.js b/commands/Administration/setfortniteshop.js index 2b65c03d8d..7d5db0f609 100644 --- a/commands/Administration/setfortniteshop.js +++ b/commands/Administration/setfortniteshop.js @@ -2,7 +2,7 @@ Discord = require("discord.js"), Canvas = require("discord-canvas"); -class Setfortniteshop extends Command { +module.exports = class extends Command { constructor(client) { super(client, { @@ -19,39 +19,44 @@ class Setfortniteshop extends Command { }); } - async run(message, args, data) { + async run(interaction, translate, data) { if (!data.config.apiKeys.fortniteFNBR || data.config.apiKeys.fortniteFNBR.length === "") { - return message.error("misc:COMMAND_DISABLED"); + return interaction.reply({ + content: translate("misc:COMMAND_DISABLED"), + ephemeral: true + }); } - if (data.guild.plugins.fortniteshop && !message.mentions.channels.first() || message.mentions.channels.first() && data.guild.plugins.fortniteshop === message.mentions.channels.first().id) { - data.guild.plugins.fortniteshop = false; - data.guild.markModified("plugins.fortniteshop"); - data.guild.save(); - return message.success("administration/setfortniteshop:DISABLED"); + if (data.guildData.plugins.fortniteshop && !message.mentions.channels.first() || message.mentions.channels.first() && data.guildData.plugins.fortniteshop === message.mentions.channels.first().id) { + data.guildData.plugins.fortniteshop = false; + data.guildData.markModified("plugins.fortniteshop"); + data.guildData.save(); + return interaction.reply({ + content: translate("administration/setfortniteshop:DISABLED") + }); } const channel = message.mentions.channels.first() || message.channel; - data.guild.plugins.fortniteshop = channel.id; - data.guild.markModified("plugins.fortniteshop"); - data.guild.save(); + data.guildData.plugins.fortniteshop = channel.id; + data.guildData.markModified("plugins.fortniteshop"); + data.guildData.save(); message.success("administration/setfortniteshop:ENABLED", { channel: channel.toString() }); - const momentName = this.client.languages.find((language) => language.name === data.guild.language || language.aliases.includes(data.guild.language)).moment; + const momentName = this.client.languages.find((language) => language.name === data.guildData.language || language.aliases.includes(data.guildData.language)).moment; const shop = new Canvas.FortniteShop(); const image = await shop .setToken(data.config.apiKeys.fortniteFNBR) - .setText("header", message.translate("general/fortniteshop:HEADER")) - .setText("daily", message.translate("general/fortniteshop:DAILY")) - .setText("featured", message.translate("general/fortniteshop:FEATURED")) - .setText("date", message.translate("general/fortniteshop:DATE", { + .setText("header", translate("general/fortniteshop:HEADER")) + .setText("daily", translate("general/fortniteshop:DAILY")) + .setText("featured", translate("general/fortniteshop:FEATURED")) + .setText("date", translate("general/fortniteshop:DATE", { skipInterpolation: true }).replace("{{date}}", "{date}")) - .setText("footer", message.translate("general/fortniteshop:FOOTER")) + .setText("footer", translate("general/fortniteshop:FOOTER")) .lang(momentName) .toAttachment(); const attachment = new Discord.MessageAttachment(image, "shop.png"); @@ -71,6 +76,4 @@ class Setfortniteshop extends Command { } -} - -module.exports = Setfortniteshop; \ No newline at end of file +}; diff --git a/commands/Administration/setlang.js b/commands/Administration/setlang.js index 94128904ea..c8729a0d36 100644 --- a/commands/Administration/setlang.js +++ b/commands/Administration/setlang.js @@ -1,6 +1,6 @@ const Command = require("../../base/Command.js"); -class Setlang extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -8,7 +8,7 @@ class Setlang extends Command { dirname: __dirname, enabled: true, guildOnly: true, - aliases: [], + , memberPermissions: [ "MANAGE_GUILD" ], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -17,7 +17,7 @@ class Setlang extends Command { }); } - async run (message, args, data) { + async run (interaction, translate, data) { const language = this.client.languages.find((l) => l.name === args[0] || l.aliases.includes(args[0])); @@ -27,13 +27,13 @@ class Setlang extends Command { }); } - data.guild.language = language.name; - await data.guild.save(); + data.guildData.language = language.name; + await data.guildData.save(); - return message.sendT("administration/setlang:SUCCESS"); + return interaction.reply({ + content: translate("administration/setlang:SUCCESS") + }); } -} - -module.exports = Setlang; \ No newline at end of file +}; diff --git a/commands/Administration/setmodlogs.js b/commands/Administration/setmodlogs.js index 80b3f04c07..77ec5d3551 100644 --- a/commands/Administration/setmodlogs.js +++ b/commands/Administration/setmodlogs.js @@ -1,7 +1,7 @@ const Command = require("../../base/Command.js"), Resolvers = require("../../helpers/resolvers"); -class Setmodlogs extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -9,7 +9,7 @@ class Setmodlogs extends Command { dirname: __dirname, enabled: true, guildOnly: true, - aliases: [ "setmodlogs" ], + memberPermissions: [ "MANAGE_GUILD" ], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -18,9 +18,9 @@ class Setmodlogs extends Command { }); } - async run (message, args, data) { + async run (interaction, translate, data) { - const areModLogsEnabled = Boolean(data.guild.plugins.modlogs); + const areModLogsEnabled = Boolean(data.guildData.plugins.modlogs); const sentChannel = await Resolvers.resolveChannel({ message, search: args.join(" "), @@ -28,17 +28,17 @@ class Setmodlogs extends Command { }); if (!sentChannel && areModLogsEnabled) { - data.guild.plugins.modlogs = null; - data.guild.markModified("plugins.modlogs"); - await data.guild.save(); + data.guildData.plugins.modlogs = null; + data.guildData.markModified("plugins.modlogs"); + await data.guildData.save(); return message.success( "administration/setmodlogs:SUCCESS_DISABLED" ); } else { const channel = sentChannel || message.channel; - data.guild.plugins.modlogs = channel.id; - data.guild.markModified("plugins.modlogs"); - await data.guild.save(); + data.guildData.plugins.modlogs = channel.id; + data.guildData.markModified("plugins.modlogs"); + await data.guildData.save(); return message.success( "administration/setmodlogs:SUCCESS_ENABLED", { @@ -48,6 +48,4 @@ class Setmodlogs extends Command { } } -} - -module.exports = Setmodlogs; \ No newline at end of file +}; diff --git a/commands/Administration/setprefix.js b/commands/Administration/setprefix.js index 9280cff69a..9ee6939002 100644 --- a/commands/Administration/setprefix.js +++ b/commands/Administration/setprefix.js @@ -1,6 +1,6 @@ const Command = require("../../base/Command.js"); -class Setprefix extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -8,7 +8,7 @@ class Setprefix extends Command { dirname: __dirname, enabled: true, guildOnly: true, - aliases: [], + , memberPermissions: [ "MANAGE_GUILD" ], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -17,18 +17,24 @@ class Setprefix extends Command { }); } - async run (message, args, data) { + async run (interaction, translate, data) { const prefix = args[0]; if(!prefix){ - return message.error("administration/setprefix:MISSING_PREFIX"); + return interaction.reply({ + content: translate("administration/setprefix:MISSING_PREFIX"), + ephemeral: true + }); } if(prefix.length > 5){ - return message.error("administration/setprefix:TOO_LONG"); + return interaction.reply({ + content: translate("administration/setprefix:TOO_LONG"), + ephemeral: true + }); } - data.guild.prefix = prefix; - data.guild.save(); + data.guildData.prefix = prefix; + data.guildData.save(); // Sucess return message.success("administration/setprefix:SUCCESS", { @@ -37,6 +43,4 @@ class Setprefix extends Command { } -} - -module.exports = Setprefix; \ No newline at end of file +}; diff --git a/commands/Administration/setreports.js b/commands/Administration/setreports.js index 7edf93f41a..e1884a39c9 100644 --- a/commands/Administration/setreports.js +++ b/commands/Administration/setreports.js @@ -1,7 +1,7 @@ const Command = require("../../base/Command.js"), Resolvers = require("../../helpers/resolvers"); -class Setreports extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -18,9 +18,9 @@ class Setreports extends Command { }); } - async run (message, args, data) { + async run (interaction, translate, data) { - const areReportsEnabled = Boolean(data.guild.plugins.reports); + const areReportsEnabled = Boolean(data.guildData.plugins.reports); const sentChannel = await Resolvers.resolveChannel({ message, search: args.join(" "), @@ -28,17 +28,17 @@ class Setreports extends Command { }); if (!sentChannel && areReportsEnabled) { - data.guild.plugins.reports = null; - data.guild.markModified("plugins.reports"); - await data.guild.save(); + data.guildData.plugins.reports = null; + data.guildData.markModified("plugins.reports"); + await data.guildData.save(); return message.success( "administration/setreports:SUCCESS_DISABLED" ); } else { const channel = sentChannel || message.channel; - data.guild.plugins.reports = channel.id; - data.guild.markModified("plugins.reports"); - await data.guild.save(); + data.guildData.plugins.reports = channel.id; + data.guildData.markModified("plugins.reports"); + await data.guildData.save(); return message.success( "administration/setreports:SUCCESS_ENABLED", { @@ -49,6 +49,4 @@ class Setreports extends Command { } -} - -module.exports = Setreports; +}; diff --git a/commands/Administration/setsuggests.js b/commands/Administration/setsuggests.js index 12099abd68..dc0786d448 100644 --- a/commands/Administration/setsuggests.js +++ b/commands/Administration/setsuggests.js @@ -1,7 +1,7 @@ const Command = require("../../base/Command.js"), Resolvers = require("../../helpers/resolvers"); -class Setsuggests extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -9,7 +9,7 @@ class Setsuggests extends Command { dirname: __dirname, enabled: true, guildOnly: true, - aliases: [ "setsuggest", "setsuggestions", "setsuggestion" ], + memberPermissions: [ "MANAGE_GUILD" ], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -18,9 +18,9 @@ class Setsuggests extends Command { }); } - async run (message, args, data) { + async run (interaction, translate, data) { - const areSuggestsEnabled = Boolean(data.guild.plugins.suggestions); + const areSuggestsEnabled = Boolean(data.guildData.plugins.suggestions); const sentChannel = await Resolvers.resolveChannel({ message, search: args.join(" "), @@ -28,17 +28,17 @@ class Setsuggests extends Command { }); if (!sentChannel && areSuggestsEnabled) { - data.guild.plugins.suggestions = null; - data.guild.markModified("plugins.suggestions"); - await data.guild.save(); + data.guildData.plugins.suggestions = null; + data.guildData.markModified("plugins.suggestions"); + await data.guildData.save(); return message.success( "administration/setsuggests:SUCCESS_DISABLED" ); } else { const channel = sentChannel || message.channel; - data.guild.plugins.suggestions = channel.id; - data.guild.markModified("plugins.suggestions"); - await data.guild.save(); + data.guildData.plugins.suggestions = channel.id; + data.guildData.markModified("plugins.suggestions"); + await data.guildData.save(); return message.success( "administration/setsuggests:SUCCESS_ENABLED", { @@ -49,6 +49,4 @@ class Setsuggests extends Command { } -} - -module.exports = Setsuggests; \ No newline at end of file +}; diff --git a/commands/Administration/slowmode.js b/commands/Administration/slowmode.js index c798e9a76c..1903a02687 100644 --- a/commands/Administration/slowmode.js +++ b/commands/Administration/slowmode.js @@ -1,7 +1,7 @@ const Command = require("../../base/Command.js"), ms = require("ms"); -class Slowmode extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -9,7 +9,7 @@ class Slowmode extends Command { dirname: __dirname, enabled: true, guildOnly: true, - aliases: [ "slowmotion" ], + memberPermissions: [ "MANAGE_GUILD" ], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -18,44 +18,51 @@ class Slowmode extends Command { }); } - async run (message, args, data) { + async run (interaction, translate, data) { - const channel = message.mentions.channels.filter((ch) => ch.type === "text" && ch.guild.id === message.guild.id).first(); + const channel = message.mentions.channels.filter((ch) => ch.type === "text" && ch.guild.id === interaction.guild.id).first(); if(!channel){ - return message.error("misc:INVALID_CHANNEL"); + return interaction.reply({ + content: translate("misc:INVALID_CHANNEL"), + ephemeral: true + }); } const time = args[1]; if(!time){ - if(!data.guild.slowmode.channels.find((ch) => ch.id === channel.id)){ - return message.error("misc:INVALID_TIME"); + if(!data.guildData.slowmode.channels.find((ch) => ch.id === channel.id)){ + return interaction.reply({ + content: translate("misc:INVALID_TIME"), + ephemeral: true + }); } - data.guild.slowmode.channels = data.guild.slowmode.channels.filter((ch) => ch.id !== channel.id); - data.guild.markModified("slowmode.channels"); - data.guild.save(); + data.guildData.slowmode.channels = data.guildData.slowmode.channels.filter((ch) => ch.id !== channel.id); + data.guildData.markModified("slowmode.channels"); + data.guildData.save(); message.success("administration/slowmode:DISABLED", { - prefix: data.guild.prefix, + prefix: data.guildData.prefix, channel: `#${channel.name}` }); } else { if(isNaN(ms(time))){ - return message.error("misc:INVALID_TIME"); + return interaction.reply({ + content: translate("misc:INVALID_TIME"), + ephemeral: true + }); } - if(data.guild.slowmode.channels.find((ch) => ch.id === channel.id)){ - data.guild.slowmode.channels = data.guild.slowmode.channels.filter((ch) => ch.id !== channel.id); + if(data.guildData.slowmode.channels.find((ch) => ch.id === channel.id)){ + data.guildData.slowmode.channels = data.guildData.slowmode.channels.filter((ch) => ch.id !== channel.id); } - data.guild.slowmode.channels.push({ + data.guildData.slowmode.channels.push({ id: channel.id, time: ms(time) }); - data.guild.markModified("slowmode.channels"); - data.guild.save(); + data.guildData.markModified("slowmode.channels"); + data.guildData.save(); message.success("administration/slowmode:ENABLED", { - prefix: data.guild.prefix, + prefix: data.guildData.prefix, channel: `#${channel.name}`, time: this.client.functions.convertTime(message.guild, ms(time)) }); } } -} - -module.exports = Slowmode; +}; diff --git a/commands/Administration/welcome.js b/commands/Administration/welcome.js index c70536cd11..80a3e9b1e4 100644 --- a/commands/Administration/welcome.js +++ b/commands/Administration/welcome.js @@ -1,7 +1,7 @@ const Command = require("../../base/Command.js"), Resolvers = require("../../helpers/resolvers"); -class Welcome extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -9,7 +9,7 @@ class Welcome extends Command { dirname: __dirname, enabled: true, guildOnly: true, - aliases: [ "bienvenue" ], + memberPermissions: [ "MANAGE_GUILD" ], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -18,33 +18,38 @@ class Welcome extends Command { }); } - async run (message, args, data) { + async run (interaction, translate, data) { if ( args[0] === "test" && - data.guild.plugins.welcome.enabled + data.guildData.plugins.welcome.enabled ) { this.client.emit("guildMemberAdd", message.member); - return message.success("administration/welcome:TEST_SUCCESS"); + return interaction.reply({ + content: translate("administration/welcome:TEST_SUCCESS") + }); } if ( (!args[0] || !["edit", "off"].includes(args[0])) && - data.guild.plugins.welcome.enabled + data.guildData.plugins.welcome.enabled ) - return message.error("administration/welcome:MISSING_STATUS"); + return interaction.reply({ + content: translate("administration/welcome:MISSING_STATUS"), + ephemeral: true + }); if (args[0] === "off") { - data.guild.plugins.welcome = { + data.guildData.plugins.welcome = { enabled: false, message: null, channelID: null, withImage: null }; - data.guild.markModified("plugins.welcome"); - data.guild.save(); + data.guildData.markModified("plugins.welcome"); + data.guildData.save(); return message.error("administration/welcome:DISABLED", { - prefix: data.guild.prefix + prefix: data.guildData.prefix }); } else { const welcome = { @@ -55,10 +60,10 @@ class Welcome extends Command { }; message.sendT("administration/welcome:FORM_1", { - author: message.author.toString() + author: interaction.user.toString() }); const collector = message.channel.createMessageCollector( - m => m.author.id === message.author.id, + m => m.author.id === interaction.user.id, { time: 120000 // 2 minutes } @@ -69,22 +74,25 @@ class Welcome extends Command { if (welcome.message) { if ( msg.content.toLowerCase() === - message.translate("common:YES").toLowerCase() + translate("common:YES").toLowerCase() ) { welcome.withImage = true; } else if ( msg.content.toLowerCase() === - message.translate("common:NO").toLowerCase() + translate("common:NO").toLowerCase() ) { welcome.withImage = false; } else { - return message.error("misc:INVALID_YES_NO"); + return interaction.reply({ + content: translate("misc:INVALID_YES_NO"), + ephemeral: true + }); } - data.guild.plugins.welcome = welcome; - data.guild.markModified("plugins.welcome"); - await data.guild.save(); + data.guildData.plugins.welcome = welcome; + data.guildData.markModified("plugins.welcome"); + await data.guildData.save(); message.sendT("administration/welcome:FORM_SUCCESS", { - prefix: data.guild.prefix, + prefix: data.guildData.prefix, channel: `<#${welcome.channel}>` }); return collector.stop(); @@ -94,9 +102,14 @@ class Welcome extends Command { if (welcome.channel && !welcome.message) { if (msg.content.length < 1800) { welcome.message = msg.content; - return message.sendT("administration/welcome:FORM_3"); + return interaction.reply({ + content: translate("administration/welcome:FORM_3") + }); } - return message.error("administration/goodbye:MAX_CHARACT"); + return interaction.reply({ + content: translate("administration/goodbye:MAX_CHARACT"), + ephemeral: true + }); } // If the channel is not filled, it means the user sent it @@ -106,7 +119,10 @@ class Welcome extends Command { channelType: "text" }); if (!channel) { - return message.error("misc:INVALID_CHANNEL"); + return interaction.reply({ + content: translate("misc:INVALID_CHANNEL"), + ephemeral: true + }); } welcome.channel = channel.id; message.sendT("administration/welcome:FORM_2", { @@ -119,12 +135,13 @@ class Welcome extends Command { collector.on("end", (_, reason) => { if (reason === "time") { - return message.error("misc:TIMEOUT"); + return interaction.reply({ + content: translate("misc:TIMEOUT"), + ephemeral: true + }); } }); } } -} - -module.exports = Welcome; +}; diff --git a/commands/Economy/achievements.js b/commands/Economy/achievements.js index f3f00874f3..3208f55b23 100644 --- a/commands/Economy/achievements.js +++ b/commands/Economy/achievements.js @@ -1,69 +1,70 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"); +const { Embed } = require("../../helpers/constants.js"); -class Achievements extends Command { +module.exports = class extends Command { constructor (client) { super(client, { name: "achievements", - dirname: __dirname, + + options: [], + enabled: true, guildOnly: false, - aliases: [ "ac" ], memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, ownerOnly: false, - cooldown: 1000 + + dirname: __dirname }); } - async run (message, args, data) { + async run (interaction, translate, { userData }) { const embed = new Discord.MessageEmbed() - .setAuthor(message.translate("economy/achievements:TITLE")) - .setColor(data.config.embed.color) - .setFooter(data.config.embed.footer); + .setAuthor(translate("economy/achievements:TITLE")) + .setColor(Embed.COLOR) + .setFooter(Embed.FOOTER); - 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, - percent: Math.round(100 * (data.userData.achievements.firstCommand.progress.now/data.userData.achievements.firstCommand.progress.total)) + embed.addField(translate("economy/achievements:SEND_CMD"), translate("economy/achievements:PROGRESS", { + now: userData.achievements.firstCommand.progress.now, + total: userData.achievements.firstCommand.progress.total, + percent: Math.round(100 * (userData.achievements.firstCommand.progress.now / userData.achievements.firstCommand.progress.total)) })); - 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, - percent: Math.round(100 * (data.userData.achievements.work.progress.now/data.userData.achievements.work.progress.total)) + embed.addField(translate("economy/achievements:CLAIM_SALARY"), translate("economy/achievements:PROGRESS", { + now: userData.achievements.work.progress.now, + total: userData.achievements.work.progress.total, + percent: Math.round(100 * (userData.achievements.work.progress.now / userData.achievements.work.progress.total)) })); - 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, - percent: Math.round(100 * (data.userData.achievements.married.progress.now/data.userData.achievements.married.progress.total)) + embed.addField(translate("economy/achievements:MARRY"), translate("economy/achievements:PROGRESS", { + now: userData.achievements.married.progress.now, + total: userData.achievements.married.progress.total, + percent: Math.round(100 * (userData.achievements.married.progress.now / userData.achievements.married.progress.total)) })); - 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, - percent: Math.round(100 * (data.userData.achievements.slots.progress.now/data.userData.achievements.slots.progress.total)) + embed.addField(translate("economy/achievements:SLOTS"), translate("economy/achievements:PROGRESS", { + now: userData.achievements.slots.progress.now, + total: userData.achievements.slots.progress.total, + percent: Math.round(100 * (userData.achievements.slots.progress.now/userData.achievements.slots.progress.total)) })); - 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, - percent: Math.round(100 * (data.userData.achievements.tip.progress.now/data.userData.achievements.tip.progress.total)) + embed.addField(translate("economy/achievements:TIP"), translate("economy/achievements:PROGRESS", { + now: userData.achievements.tip.progress.now, + total: userData.achievements.tip.progress.total, + percent: Math.round(100 * (userData.achievements.tip.progress.now/userData.achievements.tip.progress.total)) })); - 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, - percent: Math.round(100 * (data.userData.achievements.rep.progress.now/data.userData.achievements.rep.progress.total)) + embed.addField(translate("economy/achievements:REP"), translate("economy/achievements:PROGRESS", { + now: userData.achievements.rep.progress.now, + total: userData.achievements.rep.progress.total, + percent: Math.round(100 * (userData.achievements.rep.progress.now/userData.achievements.rep.progress.total)) })); - 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, - percent: Math.round(100 * (data.userData.achievements.invite.progress.now/data.userData.achievements.invite.progress.total)) + embed.addField(translate("economy/achievements:INVITE"), translate("economy/achievements:PROGRESS", { + now: userData.achievements.invite.progress.now, + total: userData.achievements.invite.progress.total, + percent: Math.round(100 * (userData.achievements.invite.progress.now/userData.achievements.invite.progress.total)) })); - message.channel.send({ embeds: [embed] }); + interaction.reply({ embeds: [embed] }); } -} - -module.exports = Achievements; +}; diff --git a/commands/Economy/birthdate.js b/commands/Economy/birthdate.js index 2b94c3712b..573c679e78 100644 --- a/commands/Economy/birthdate.js +++ b/commands/Economy/birthdate.js @@ -1,39 +1,50 @@ const Command = require("../../base/Command.js"); -class Birthdate extends Command { +module.exports = class extends Command { constructor (client) { super(client, { name: "birthdate", - dirname: __dirname, + + options: [ + { + name: "date", + type: "STRING", + required: true + } + ], + enabled: true, guildOnly: false, - aliases: [ "anniversaire" ], memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, ownerOnly: false, - cooldown: 1000 + + dirname: __dirname }); } - async run (message, args, data) { + async run (interaction, translate, { userData, guildData }) { - const date = args[0]; - if(!date){ - return message.error("economy/birthdate:MISSING_DATE"); - } + const date = interaction.options.getString("date"); const tArgs = date.split("/"); const [day, month, year] = tArgs; if(!day || !month || !year){ - return message.error("economy/birthdate:INVALID_DATE"); + return interaction.reply({ + content: "economy/birthdate:INVALID_DATE", + ephemeral: true + }); } // Gets the string of the date const match = date.match(/\d+/g); if (!match){ - return message.error("economy/birthdate:INVALID_DATE_FORMAT"); + return interaction.reply({ + content: "economy/birthdate:INVALID_DATE_FORMAT", + ephemeral: true + }); } const tday = +match[0], tmonth = +match[1] - 1; let tyear = +match[2]; @@ -42,24 +53,33 @@ class Birthdate extends Command { } const d = new Date(tyear, tmonth, tday); if(!(tday == d.getDate() && tmonth == d.getMonth() && tyear == d.getFullYear())){ - return message.error("economy/birthdate:INVALID_DATE_FORMAT"); + return interaction.reply({ + content: translate("economy/birthdate:INVALID_DATE_FORMAT"), + ephemeral: true + }); } if(d.getTime() > Date.now()){ - return message.error("economy/birthdate:DATE_TOO_HIGH"); + return interaction.reply({ + content: translate("economy/birthdate:DATE_TOO_HIGH"), + ephemeral: true + }); } if(d.getTime() < (Date.now()-2.523e+12)){ - return message.error("economy/birthdate:DATE_TOO_LOW"); + return interaction.reply({ + content: translate("economy/birthdate:DATE_TOO_LOW"), + ephemeral: true + }); } - data.userData.birthdate = d; - data.userData.save(); + userData.birthdate = d; + userData.save(); - message.success("economy/birthdate:SUCCESS", { - date: message.printDate(d) + interaction.reply({ + content: translate("economy/birthdate:SUCCESS", { + date: this.client.printDate(d, null, guildData.language) + }) }); } -} - -module.exports = Birthdate; +}; diff --git a/commands/Economy/deposit.js b/commands/Economy/deposit.js index a0085952a5..1b3de00479 100644 --- a/commands/Economy/deposit.js +++ b/commands/Economy/deposit.js @@ -1,54 +1,58 @@ const Command = require("../../base/Command.js"); -class Deposit extends Command { +module.exports = class extends Command { constructor (client) { super(client, { name: "deposit", - dirname: __dirname, + + options: [ + { + name: "amount", + type: "INTEGER" + } + ], + enabled: true, guildOnly: true, - aliases: [ "bank", "banque", "dep" ], + memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, ownerOnly: false, - cooldown: 1000 + + dirname: __dirname }); } - async run (message, args, data) { + async run (interaction, translate, { memberData }) { - let amount = args[0]; - - if(!(parseInt(data.memberData.money, 10) > 0)) { - return message.error("economy/deposit:NO_CREDIT"); - } + const amount = interaction.options.getInteger("amount"); - if(args[0] === "all"){ - amount = parseInt(data.memberData.money, 10); - } else { - if(isNaN(amount) || parseInt(amount, 10) < 1){ - return message.error("economy/deposit:MISSING_AMOUNT"); - } - amount = parseInt(amount, 10); + if(!(parseInt(memberData.money, 10) > 0)) { + return interaction.reply({ + content: translate("economy/deposit:NO_CREDIT"), + ephemeral: true + }); } - if(data.memberData.money < amount){ - return message.error("economy/deposit:NOT_ENOUGH_CREDIT", { - money: amount + if(memberData.money < amount){ + return interaction.reply({ + content: translate("economy/deposit:NOT_ENOUGH_CREDIT", { + money: amount + }) }); } - data.memberData.money = data.memberData.money - amount; - data.memberData.bankSold = data.memberData.bankSold + amount; - data.memberData.save(); + memberData.money = memberData.money - amount; + memberData.bankSold = memberData.bankSold + amount; + memberData.save(); - message.success("economy/deposit:SUCCESS", { - money: amount + interaction.reply({ + content: translate("economy/deposit:SUCCESS", { + money: amount + }) }); } -} - -module.exports = Deposit; +}; diff --git a/commands/Economy/divorce.js b/commands/Economy/divorce.js index 5ee87e5556..e058a0aecf 100644 --- a/commands/Economy/divorce.js +++ b/commands/Economy/divorce.js @@ -1,47 +1,50 @@ const Command = require("../../base/Command.js"); -class Divorce extends Command { +module.exports = class extends Command { constructor (client) { super(client, { name: "divorce", - dirname: __dirname, + enabled: true, guildOnly: false, - aliases: [ "profil" ], + memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, ownerOnly: false, - cooldown: 3000 + + dirname: __dirname }); } - async run (message, args, data) { + async run (interaction, translate, { userData }) { // Check if the message author is wedded - if(!data.userData.lover){ - return message.error("economy/divorce:NOT_MARRIED"); + if(!userData.lover){ + return interaction.reply({ + content: translate("economy/divorce:NOT_MARRIED"), + ephemeral: true + }); } // Updates db + const user = this.client.users.cache.get(userData.lover) || await this.client.users.fetch(userData.lover); - const user = this.client.users.cache.get(data.userData.lover) || await this.client.users.fetch(data.userData.lover); - - data.userData.lover = null; - data.userData.save(); + userData.lover = null; + userData.save(); const oldLover = await this.client.findOrCreateUser({ id:user.id }); oldLover.lover = null; oldLover.save(); // Send success message - message.success("economy/divorce:SUCCESS", { - username: user.username + interaction.reply({ + content: translate("economy/divorce:SUCCESS", { + username: user.username + }) }); } -} - -module.exports = Divorce; \ No newline at end of file +}; diff --git a/commands/Economy/leaderboard.js b/commands/Economy/leaderboard.js index 3599464937..12e6cdfde6 100644 --- a/commands/Economy/leaderboard.js +++ b/commands/Economy/leaderboard.js @@ -1,34 +1,41 @@ const Command = require("../../base/Command.js"), AsciiTable = require("ascii-table"); -class Leaderboard extends Command { +module.exports = class extends Command { constructor (client) { super(client, { name: "leaderboard", - dirname: __dirname, + + options: [ + { + name: "type", + type: "STRING", + choices: ["money", "level", "rep"].map((c) => ({ name: c, value: c })) + } + ], + enabled: true, guildOnly: true, - aliases: [ "lb" ], + memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, ownerOnly: false, - cooldown: 5000 + cooldown: 5000, + + dirname: __dirname }); } - async run (message, args) { + async run (interaction, translate) { - const isOnlyOnMobile = (message.author.presence.clientStatus ? JSON.stringify(Object.keys(message.author.presence.clientStatus)) === JSON.stringify([ "mobile" ]) : false); + const isOnlyOnMobile = (interaction.user.presence.clientStatus ? JSON.stringify(Object.keys(interaction.user.presence.clientStatus)) === JSON.stringify([ "mobile" ]) : false); - const type = args[0]; - if(!type || (type !== "credits" && type !== "level" && type !== "rep")){ - return message.error("economy/leaderboard:MISSING_TYPE"); - } + const type = interaction.options.getString("type"); if(type === "credits"){ - const members = await this.client.membersData.find({ guildID: message.guild.id }).lean(), + const members = await this.client.membersData.find({ guildID: interaction.guild.id }).lean(), membersLeaderboard = members.map((m) => { return { id: m.id, @@ -36,12 +43,12 @@ class Leaderboard extends Command { }; }).sort((a,b) => b.value - a.value); const table = new AsciiTable("LEADERBOARD"); - table.setHeading("#", message.translate("common:USER"), message.translate("common:CREDITS")); + table.setHeading("#", translate("common:USER"), translate("common:CREDITS")); if(membersLeaderboard.length > 20) membersLeaderboard.length = 20; const newTable = await fetchUsers(membersLeaderboard, table, this.client); - message.channel.send("```\n"+newTable.toString()+"```"); + interaction.reply("```\n"+newTable.toString()+"```"); } else if(type === "level"){ - const members = await this.client.membersData.find({ guildID: message.guild.id }).lean(), + const members = await this.client.membersData.find({ guildID: interaction.guild.id }).lean(), membersLeaderboard = members.map((m) => { return { id: m.id, @@ -49,10 +56,10 @@ class Leaderboard extends Command { }; }).sort((a,b) => b.value - a.value); const table = new AsciiTable("LEADERBOARD"); - table.setHeading("#", message.translate("common:USER"), message.translate("common:LEVEL")); + table.setHeading("#", translate("common:USER"), translate("common:LEVEL")); if(membersLeaderboard.length > 20) membersLeaderboard.length = 20; const newTable = await fetchUsers(membersLeaderboard, table, this.client); - message.channel.send("```\n"+newTable.toString()+"```"); + interaction.reply("```\n"+newTable.toString()+"```"); } else if(type === "rep"){ const users = await this.client.usersData.find().lean(), usersLeaderboard = users.map((u) => { @@ -62,14 +69,17 @@ class Leaderboard extends Command { }; }).sort((a,b) => b.value - a.value); const table = new AsciiTable("LEADERBOARD"); - table.setHeading("#", message.translate("common:USER"), message.translate("common:POINTS")); + table.setHeading("#", translate("common:USER"), translate("common:POINTS")); if(usersLeaderboard.length > 20) usersLeaderboard.length = 20; const newTable = await fetchUsers(usersLeaderboard, table, this.client); - message.channel.send("```\n"+newTable.toString()+"```"); + interaction.reply("```\n"+newTable.toString()+"```"); } if(isOnlyOnMobile){ - message.sendT("economy/leaderboard:MOBILE"); + // TODO: add a better way to answer here + interaction.channel.send({ + content: translate("economy/leaderboard:MOBILE") + }); } async function fetchUsers(array, table, client) { @@ -90,6 +100,4 @@ class Leaderboard extends Command { } } -} - -module.exports = Leaderboard; +}; diff --git a/commands/Economy/marry.js b/commands/Economy/marry.js index 5ddd4ec534..ded5ed9dbe 100644 --- a/commands/Economy/marry.js +++ b/commands/Economy/marry.js @@ -4,120 +4,156 @@ const Command = require("../../base/Command.js"), // An object to store pending requests const pendings = {}; -class Marry extends Command { +module.exports = class extends Command { constructor (client) { super(client, { name: "marry", - dirname: __dirname, + + options: [ + { + name: "user", + type: "USER", + required: true + } + ], + enabled: true, guildOnly: true, - aliases: [ "mariage" ], + memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, ownerOnly: false, - cooldown: 10000 + + dirname: __dirname }); } - async run (message, args, data) { + async run (interaction, translate, data) { // if the message author is already wedded if(data.userData.lover){ - return message.error("economy/marry:ALREADY_MARRIED", { - prefix: data.guild.prefix + return interaction.reply({ + content: translate("economy/marry:ALREADY_MARRIED", { + prefix: data.guildData.prefix + }), + ephemeral: true }); } - // Gets the first mentionned member - const member = await this.client.resolveMember(args[0], message.guild); - if(!member){ - return message.error("economy/marry:INVALID_MEMBER"); - } + const user = interaction.options.getUser("user"); - const userData = await this.client.findOrCreateUser({ id: member.id }); + const userData = await this.client.findOrCreateUser({ id: user.id }); // if the member is already wedded if(userData.lover){ - return message.error("economy/marry:ALREADY_MARRIED_USER", { - username: member.user.tag + return interaction.reply({ + content: translate("economy/marry:ALREADY_MARRIED_USER", { + username: user.tag + }), + ephemeral: true }); } - if(member.user.bot){ - return message.error("economy/marry:BOT_USER"); + if(user.bot){ + return interaction.reply({ + content: translate("economy/marry:BOT_USER"), + ephemeral: true + }); } - if(member.id === message.author.id){ - return message.error("economy/marry:YOURSELF"); + if(user.id === interaction.user.id){ + return interaction.reply({ + content: translate("economy/marry:YOURSELF"), + ephemeral: true + }); } for(const requester in pendings){ const receiver = pendings[requester]; // If the member already sent a request to someone - if(requester === message.author.id){ + if(requester === interaction.user.id){ const user = this.client.users.cache.get(receiver) || await this.client.users.fetch(receiver); - return message.error("economy/marry:REQUEST_AUTHOR_TO_AMEMBER", { - username: user.tag + return interaction.reply({ + content: translate("economy/marry:REQUEST_AUTHOR_TO_AMEMBER", { + username: user.tag + }), + ephemeral: true }); - } else if (receiver === message.author.id){ // If there is a pending request for this member - const user = this.client.users.cache.get(requester) || await this.client.users.fetch(requester); - return message.error("economy/marry:REQUEST_AMEMBER_TO_AUTHOR", { - username: user.tag + } else if (receiver === interaction.user.id){ // If there is a pending request for this member + const user = this.client.users.cache.get(requester) || await this.client.users.fetch(requester); + return interaction.reply({ + content: translate("economy/marry:REQUEST_AMEMBER_TO_AUTHOR", { + username: user.tag + }), + ephemeral: true }); - } else if(requester === member.id){ // If the asked member has sent pending request + } else if(requester === user.id){ // If the asked member has sent pending request const user = this.client.users.cache.get(receiver) || await this.client.users.fetch(receiver); - return message.error("economy/marry:REQUEST_AMEMBER_TO_MEMBER", { - firstUsername: member.user.tag, - secondUsername: user.tag + return interaction.reply({ + content: translate("economy/marry:REQUEST_AMEMBER_TO_MEMBER", { + firstUsername: user.tag, + secondUsername: user.tag + }), + ephemeral: true }); - } else if (receiver === member.id){ // If there is a pending request for the asked member + } else if (receiver === user.id){ // If there is a pending request for the asked member const user = this.client.users.cache.get(requester) || await this.client.users.fetch(requester); - return message.error("economy/marry:REQUEST_MEMBER_TO_AMEMBER", { - firstUsername: member.user.tag, - secondUsername: user.tag + return interaction.reply({ + content: translate("economy/marry:REQUEST_MEMBER_TO_AMEMBER", { + firstUsername: user.tag, + secondUsername: user.tag + }), + ephemeral: true }); } } // Update pending requests - pendings[message.author.id] = member.id; + pendings[interaction.user.id] = user.id; - message.sendT("economy/marry:REQUEST", { - from: message.author.toString(), - to: member.user.toString() + interaction.channel.send({ + content: translate("economy/marry:REQUEST", { + from: interaction.user.toString(), + to: user.toString() + }) }); - const collector = new Discord.MessageCollector(message.channel, (m) => m.author.id === member.id, { + const collector = new Discord.MessageCollector(interaction.channel, (m) => m.author.id === user.id, { time: 120000 }); collector.on("collect", (msg) => { - if(msg.content.toLowerCase() === message.translate("common:YES").toLowerCase()){ + if(msg.content.toLowerCase() === translate("common:YES").toLowerCase()){ return collector.stop(true); } - if(msg.content.toLowerCase() === message.translate("common:NO").toLowerCase()){ + if(msg.content.toLowerCase() === translate("common:NO").toLowerCase()){ return collector.stop(false); } else { - return message.error("misc:INVALID_YES_NO"); + return interaction.channel.send({ + content: translate("misc:INVALID_YES_NO"), + ephemeral: true + }); } }); collector.on("end", async (_collected, reason) => { // Delete pending request - delete pendings[message.author.id]; + delete pendings[interaction.user.id]; if(reason === "time"){ - return message.error("economy/marry:TIMEOUT", { - username: member.user.toString() + return interaction.channel.send({ + content: translate("economy/marry:TIMEOUT", { + username: user.toString() + }) }); } if(reason){ - data.userData.lover = member.id; + data.userData.lover = user.id; await data.userData.save(); - userData.lover = message.author.id; + userData.lover = interaction.user.id; await userData.save(); const messageOptions = { - content: `${member.toString()} :heart: ${message.author.toString()}`, + content: `${user.toString()} :heart: ${interaction.user.toString()}`, files: [ { name: "unlocked.png", @@ -127,7 +163,7 @@ class Marry extends Command { }; let sent = false; if(!userData.achievements.married.achieved){ - message.channel.send(messageOptions); + interaction.channel.send(messageOptions); sent = true; userData.achievements.married.achieved = true; userData.achievements.married.progress.now = 1; @@ -135,26 +171,28 @@ class Marry extends Command { userData.save(); } if(!data.userData.achievements.married.achieved){ - if(!sent) message.channel.send(messageOptions); + if(!sent) interaction.channel.send(messageOptions); data.userData.achievements.married.achieved = true; data.userData.achievements.married.progress.now = 1; data.userData.markModified("achievements.married"); data.userData.save(); } - return message.success("economy/marry:SUCCESS", { - creator: message.author.toString(), - partner: member.user.toString() + return interaction.reply({ + content: translate("economy/marry:SUCCESS", { + creator: interaction.user.toString(), + partner: user.toString() + }) }); } else { - return message.success("economy/marry:DENIED", { - creator: message.author.toString(), - partner: member.user.toString() + return interaction.reply({ + content: translate("economy/marry:DENIED", { + creator: interaction.user.toString(), + partner: user.toString() + }) }); } }); } -} - -module.exports = Marry; \ No newline at end of file +}; diff --git a/commands/Economy/money.js b/commands/Economy/money.js index 4dca632786..03cd3e25c5 100644 --- a/commands/Economy/money.js +++ b/commands/Economy/money.js @@ -7,61 +7,69 @@ const asyncForEach = async (array, callback) => { } }; -class Credits extends Command { +module.exports = class extends Command { constructor (client) { super(client, { name: "money", - dirname: __dirname, + + options: [ + { + name: "user", + type: "USER", + required: false + } + ], + enabled: true, guildOnly: true, - aliases: [ "credits", "balance" ], memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, ownerOnly: false, - cooldown: 1000 + cooldown: 1000, + + dirname: __dirname }); } - async run (message, args, data) { + async run (interaction, translate, data) { - let member = await this.client.resolveMember(args[0], message.guild); - if(!member) member = message.member; - const user = member.user; + const user = interaction.options.getUser("user") || interaction.user; if(user.bot){ - return message.error("misc:BOT_USER"); + return interaction.reply({ + content: translate("misc:BOT_USER"), + ephemeral: true + }); } - const memberData = (message.author === user) ? data.memberData : await this.client.findOrCreateMember({ id: user.id, guildID: message.guild.id }); + const memberData = (interaction.user === user) ? data.memberData : await this.client.findOrCreateMember({ id: user.id, guildID: interaction.guild.id }); const commonsGuilds = this.client.guilds.cache.filter((g) => g.members.cache.get(user.id)); let globalMoney = 0; await asyncForEach(commonsGuilds.array(), async (guild) => { const memberData = await this.client.findOrCreateMember({ id: user.id, guildID: guild.id }); - globalMoney+=memberData.money; - globalMoney+=memberData.bankSold; + globalMoney += memberData.money; + globalMoney += memberData.bankSold; }); const embed = new Discord.MessageEmbed() - .setAuthor(message.translate("economy/money:TITLE", { - username: member.user.username - }), member.user.displayAvatarURL({ size: 512, dynamic: true, format: 'png' })) - .addField(message.translate("economy/profile:CASH"), message.translate("economy/profile:MONEY", { + .setAuthor(translate("economy/money:TITLE", { + username: user.username + }), user.displayAvatarURL({ size: 512, dynamic: true, format: "png" })) + .addField(translate("economy/profile:CASH"), translate("economy/profile:MONEY", { money: memberData.money }), true) - .addField(message.translate("economy/profile:BANK"), message.translate("economy/profile:MONEY", { + .addField(translate("economy/profile:BANK"), translate("economy/profile:MONEY", { money: memberData.bankSold }), true) - .addField(message.translate("economy/profile:GLOBAL"), message.translate("economy/profile:MONEY", { + .addField(translate("economy/profile:GLOBAL"), translate("economy/profile:MONEY", { money: globalMoney }), true) .setColor(this.client.config.embed.color) .setFooter(this.client.config.embed.footer); - message.channel.send({ embeds: [embed] }); + interaction.channel.send({ embeds: [embed] }); } -} - -module.exports = Credits; +}; diff --git a/commands/Economy/pay.js b/commands/Economy/pay.js index b458540340..5104ae55f7 100644 --- a/commands/Economy/pay.js +++ b/commands/Economy/pay.js @@ -1,51 +1,71 @@ const Command = require("../../base/Command.js"); -class Pay extends Command { +module.exports = class extends Command { constructor (client) { super(client, { name: "pay", - dirname: __dirname, + + options: [ + { + name: "user", + type: "USER", + required: true + }, + { + name: "amount", + type: "INTEGER", + required: true + } + ], + enabled: true, guildOnly: true, - aliases: [], memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, ownerOnly: false, - cooldown: 10000 + + dirname: __dirname }); } - async run (message, args, data) { + async run (interaction, translate, data) { - const member = await this.client.resolveMember(args[0], message.guild); - if(!member){ - return message.error("economy/pay:INVALID_MEMBER"); - } + const member = interaction.options.getUser("user"); if(member.user.bot){ - return message.error("economy/pay:BOT_USER"); + return interaction.reply({ + content: translate("economy/pay:BOT_USER"), + ephemeral: true + }); } - if(member.id === message.author.id){ - return message.error("economy/pay:YOURSELF"); + if(member.id === interaction.user.id){ + return interaction.reply({ + content: translate("economy/pay:YOURSELF"), + ephemeral: true + }); } - const sentAmount = args[1]; - if(!sentAmount || isNaN(sentAmount) || parseInt(sentAmount, 10) <= 0){ - return message.error("economy/pay:INVALID_AMOUNT", { - username: member.user.tag + const sentAmount = interaction.options.getInteger("amount"); + if(parseInt(sentAmount, 10) <= 0){ + return interaction.reply({ + content: translate("economy/pay:POSITIVE_INT_AMOUNT"), + ephemeral: true }); } const amount = Math.ceil(parseInt(sentAmount, 10)); if(amount > data.memberData.money){ - return message.error("economy/pay:ENOUGH_MONEY", { - amount, - username: member.user.tag + return interaction.reply({ + content: translate("economy/pay:ENOUGH_MONEY", { + amount, + username: member.user.tag + }), + ephemeral: true }); } - const memberData = await this.client.findOrCreateMember({ id: member.id, guildID: message.guild.id }); + const memberData = await this.client.findOrCreateMember({ id: member.id, guildID: interaction.guild.id }); data.memberData.money = data.memberData.money - parseInt(amount, 10); data.memberData.save(); @@ -54,13 +74,15 @@ class Pay extends Command { memberData.save(); // Send a success message - message.success("economy/pay:SUCCESS", { - amount, - username: member.user.tag + interaction.reply({ + content: translate("economy/pay:SUCCESS", { + amount, + username: member.user.tag + }) }); } -} +}; -module.exports = Pay; \ No newline at end of file + diff --git a/commands/Economy/profile.js b/commands/Economy/profile.js index 27a03f9ef4..a11e3a5fe7 100644 --- a/commands/Economy/profile.js +++ b/commands/Economy/profile.js @@ -7,86 +7,93 @@ const asyncForEach = async (array, callback) => { } }; -class Profile extends Command { +module.exports = class extends Command { constructor (client) { super(client, { name: "profile", - dirname: __dirname, + + options: [ + { + name: "user", + type: "USER" + } + ], + enabled: true, guildOnly: true, - aliases: [ "profil" ], memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, ownerOnly: false, - cooldown: 3000 + + dirname: __dirname }); } - async run (message, args, data) { + async run (interaction, translate, data) { const client = this.client; - let member = await client.resolveMember(args[0], message.guild); - if(!member) member = message.member; + const user = interaction.options.getUser("user") || interaction.user; // Check if the user is a bot - if(member.user.bot){ - return message.error("economy/profile:BOT_USER"); + if(user.bot){ + return interaction.reply({ + content: translate("economy/profile:BOT_USER"), + ephemeral: true + }); } // Gets the data of the user whose profile you want to display - const memberData = (member.id === message.author.id ? data.memberData : await client.findOrCreateMember({ id: member.id, guildID: message.guild.id})); - const userData = (member.id === message.author.id ? data.userData : await client.findOrCreateUser({ id: member.id })); + const memberData = (user.id === interaction.user.id ? data.memberData : await client.findOrCreateMember({ id: user.id, guildID: interaction.guild.id})); + const userData = (user.id === interaction.user.id ? data.userData : await client.findOrCreateUser({ id: user.id })); // Check if the lover is cached if(userData.lover && !this.client.users.cache.get(userData.lover)){ await this.client.users.fetch(userData.lover, true); } - const commonsGuilds = client.guilds.cache.filter((g) => g.members.cache.get(member.id)); + const commonsGuilds = client.guilds.cache.filter((g) => g.members.cache.get(user.id)); let globalMoney = 0; await asyncForEach(commonsGuilds.array(), async (guild) => { - const memberData = await client.findOrCreateMember({ id: member.id, guildID: guild.id }); + const memberData = await client.findOrCreateMember({ id: user.id, guildID: guild.id }); globalMoney+=memberData.money; globalMoney+=memberData.bankSold; }); const profileEmbed = new Discord.MessageEmbed() - .setAuthor(message.translate("economy/profile:TITLE", { - username: member.user.tag - }), member.user.displayAvatarURL({ size: 512, dynamic: true, format: "png" })) + .setAuthor(translate("economy/profile:TITLE", { + username: user.tag + }), 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")) - .addField(message.translate("economy/profile:CASH"), message.translate("economy/profile:MONEY", { + .setDescription(userData.bio ? userData.bio : translate("economy/profile:NO_BIO")) + .addField(translate("economy/profile:CASH"), translate("economy/profile:MONEY", { money: memberData.money }), true) - .addField(message.translate("economy/profile:BANK"), message.translate("economy/profile:MONEY", { + .addField(translate("economy/profile:BANK"), translate("economy/profile:MONEY", { money: memberData.bankSold }), true) - .addField(message.translate("economy/profile:GLOBAL"), message.translate("economy/profile:MONEY", { + .addField(translate("economy/profile:GLOBAL"), translate("economy/profile:MONEY", { money: globalMoney }), true) - .addField(message.translate("economy/profile:REPUTATION"), message.translate("economy/profile:REP_POINTS", { + .addField(translate("economy/profile:REPUTATION"), translate("economy/profile:REP_POINTS", { points: userData.rep }), true) - .addField(message.translate("economy/profile:LEVEL"), `**${memberData.level}**`, true) - .addField(message.translate("economy/profile:EXP"), `**${memberData.exp}** xp`, true) - .addField(message.translate("economy/profile:REGISTERED"), message.printDate(new Date(memberData.registeredAt)), true) - .addField(message.translate("economy/profile:BIRTHDATE"), (!userData.birthdate ? message.translate("economy/profile:NO_BIRTHDATE"): message.printDate(new Date(userData.birthdate))), true) - .addField(message.translate("economy/profile:LOVER"), (!userData.lover ? message.translate("economy/profile:NO_LOVER") : this.client.users.cache.get(userData.lover).tag), true) - .addField(message.translate("economy/profile:ACHIEVEMENTS"), message.translate("economy/profile:ACHIEVEMENTS_CONTENT", { - prefix: data.guild.prefix + .addField(translate("economy/profile:LEVEL"), `**${memberData.level}**`, true) + .addField(translate("economy/profile:EXP"), `**${memberData.exp}** xp`, true) + .addField(translate("economy/profile:REGISTERED"), this.client.printDate(new Date(memberData.registeredAt), null, data.guildData.language), true) + .addField(translate("economy/profile:BIRTHDATE"), (!userData.birthdate ? translate("economy/profile:NO_BIRTHDATE"): this.client.printDate(new Date(userData.birthdate), null, data.guildData.language)), true) + .addField(translate("economy/profile:LOVER"), (!userData.lover ? translate("economy/profile:NO_LOVER") : this.client.users.cache.get(userData.lover).tag), true) + .addField(translate("economy/profile:ACHIEVEMENTS"), translate("economy/profile:ACHIEVEMENTS_CONTENT", { + prefix: data.guildData.prefix })) .setColor(data.config.embed.color) // Sets the color of the embed .setFooter(data.config.embed.footer) // Sets the footer of the embed .setTimestamp(); - message.channel.send({ embeds: [profileEmbed] }); // Send the embed in the current channel + interaction.reply({ embeds: [profileEmbed] }); // Send the embed in the current channel } -} - -module.exports = Profile; \ No newline at end of file +}; diff --git a/commands/Economy/rep.js b/commands/Economy/rep.js index 2dde65b09a..7e50df8785 100644 --- a/commands/Economy/rep.js +++ b/commands/Economy/rep.js @@ -1,23 +1,31 @@ const Command = require("../../base/Command.js"); -class Rep extends Command { +module.exports = class extends Command { constructor (client) { super(client, { name: "rep", - dirname: __dirname, + + options: [ + { + name: "user", + type: "USER", + required: true + } + ], + enabled: true, guildOnly: true, - aliases: [ "reputation" ], memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, ownerOnly: false, - cooldown: 3000 + + dirname: __dirname }); } - async run (message, args, data) { + async run (interaction, translate, data) { // if the member is already in the cooldown db const isInCooldown = (data.userData.cooldowns || { rep: 0 }).rep; @@ -26,21 +34,32 @@ class Rep extends Command { when the member will be able to execute the order again is greater than the current date, display an error message */ if(isInCooldown > Date.now()){ - return message.error("economy/rep:COOLDOWN", { - time: message.convertTime(isInCooldown, "to", true) + return interaction.reply({ + content: translate("economy/rep:COOLDOWN", { + time: this.client.convertTime(isInCooldown, "to", true, data.guildData.language) + }) }); } } - const user = await this.client.resolveUser(args[0]); + const user = interaction.options.getUser("user"); if(!user){ - return message.error("economy/rep:INVALID_USER"); + return interaction.reply({ + content: translate("economy/rep:INVALID_USER"), + ephemeral: true + }); } if(user.bot){ - return message.error("economy/rep:BOT_USER"); + return interaction.reply({ + content: translate("economy/rep:BOT_USER"), + ephemeral: true + }); } - if(user.id === message.author.id){ - return message.error("economy/rep:YOURSELF"); + if(user.id === interaction.user.id){ + return interaction.reply({ + content: translate("economy/rep:YOURSELF"), + ephemeral: true + }); } // Records in the database the time when the member will be able to execute the command again (in 12 hours) @@ -56,18 +75,18 @@ class Rep extends Command { userData.achievements.rep.progress.now = (userData.rep > userData.achievements.rep.progress.total ? userData.achievements.rep.progress.total : userData.rep); if(userData.achievements.rep.progress.now >= userData.achievements.rep.progress.total){ userData.achievements.rep.achieved = true; - message.channel.send({ files: [ { name: "unlocked.png", attachment: "./assets/img/achievements/achievement_unlocked6.png"}]}); + interaction.channel.send({ files: [ { name: "unlocked.png", attachment: "./assets/img/achievements/achievement_unlocked6.png"}]}); } userData.markModified("achievements.rep"); } await userData.save(); - message.success("economy/rep:SUCCESS", { - username: user.username + interaction.reply({ + content: translate("economy/rep:SUCCESS", { + username: user.username + }) }); } -} - -module.exports = Rep; \ No newline at end of file +}; diff --git a/commands/Economy/rob.js b/commands/Economy/rob.js index 3cd58584ba..26792fffb0 100644 --- a/commands/Economy/rob.js +++ b/commands/Economy/rob.js @@ -1,63 +1,91 @@ const Command = require("../../base/Command.js"); -class Rob extends Command { +module.exports = class extends Command { constructor (client) { super(client, { name: "rob", - dirname: __dirname, + + options: [ + { + name: "user", + type: "USER" + }, + { + name: "amount", + type: "INTEGER" + } + ], + enabled: true, guildOnly: true, - aliases: [ "steal" ], memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, ownerOnly: false, - cooldown: 1000 + + dirname: __dirname }); } - async run (message, args, data) { + async run (interaction, translate, data) { - const member = await this.client.resolveMember(args[0], message.guild); - if(!member){ - return message.error("economy/rob:MISSING_MEMBER"); + const user = interaction.options.getUser("user"); + if(!user){ + return interaction.reply({ + content: translate("economy/rob:MISSING_MEMBER"), + ephemeral: true + }); } - if(member.id === message.author.id){ - return message.error("economy/rob:YOURSELF"); + if(user.id === interaction.user.id){ + return interaction.reply({ + content: translate("economy/rob:YOURSELF"), + ephemeral: true + }); } - const memberData = await this.client.findOrCreateMember({ id: member.id, guildID: message.guild.id }); + const memberData = await this.client.findOrCreateMember({ id: user.id, guildID: interaction.guild.id }); const isInCooldown = memberData.cooldowns.rob || 0; if(isInCooldown){ if(isInCooldown > Date.now()){ - return message.error("economy/rob:COOLDOWN", { - username: member.user.tag + return interaction.reply({ + content: translate("economy/rob:COOLDOWN", { + username: user.tag + }), + ephemeral: true }); } } - let amountToRob = args[1]; + let amountToRob = interaction.options.getInteger("amount"); if(!amountToRob || isNaN(amountToRob) || parseInt(amountToRob, 10) <= 0){ - return message.error("economy/rob:MISSING_AMOUNT", { - username: member.user.username + return interaction.reply({ + content: translate("economy/rob:MISSING_AMOUNT", { + username: user.username + }), + ephemeral: true }); } amountToRob = Math.floor(parseInt(amountToRob, 10)); if(amountToRob > memberData.money){ - return message.error("economy/rob:NOT_ENOUGH_MEMBER", { - username: member.user.username, - money: amountToRob + return interaction.reply({ + content: translate("economy/rob:NOT_ENOUGH_MEMBER", { + username: user.username, + money: amountToRob + }) }); } const potentiallyLose = Math.floor(amountToRob*1.5); if(potentiallyLose > data.memberData.money){ - return message.error("economy/rob:NOT_ENOUGH_AUTHOR", { - moneyMin: potentiallyLose, - moneyCurrent: data.memberData.money + return interaction.reply({ + content: translate("economy/rob:NOT_ENOUGH_AUTHOR", { + moneyMin: potentiallyLose, + moneyCurrent: data.memberData.money + }), + ephemeral: true }); } @@ -69,9 +97,11 @@ class Rob extends Command { memberData.markModified("cooldowns"); await memberData.save(); const randomNum = Math.floor(this.client.functions.randomNum(1, 3)); - message.sendT("economy/rob:ROB_WON_"+randomNum, { - money: amountToRob, - username: member.user.username + interaction.reply({ + content: translate("economy/rob:ROB_WON_"+randomNum, { + money: amountToRob, + username: user.username + }) }); data.memberData.money += amountToRob; memberData.money -= amountToRob, 10; @@ -80,10 +110,12 @@ class Rob extends Command { } else { const won = Math.floor(0.9*amountToRob); const randomNum = Math.floor(this.client.functions.randomNum(1, 3)); - message.sendT("economy/rob:ROB_LOSE_"+randomNum, { - fine: potentiallyLose, - offset: won, - username: member.user.username + interaction.reply({ + content: translate("economy/rob:ROB_LOSE_"+randomNum, { + fine: potentiallyLose, + offset: won, + username: user.username + }) }); data.memberData.money -= potentiallyLose; memberData.money += won; @@ -94,6 +126,4 @@ class Rob extends Command { } -} - -module.exports = Rob; +}; diff --git a/commands/Economy/setbio.js b/commands/Economy/setbio.js index 39b2ae7874..9d09f5f8a1 100644 --- a/commands/Economy/setbio.js +++ b/commands/Economy/setbio.js @@ -1,35 +1,48 @@ const Command = require("../../base/Command.js"); -class Setbio extends Command { +module.exports = class extends Command { constructor (client) { super(client, { name: "setbio", - dirname: __dirname, + + options: [ + { + name: "bio", + type: "STRING" + } + ], + enabled: true, guildOnly: false, - aliases: [ "biography", "setdesc" ], memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, ownerOnly: false, - cooldown: 5000 + + dirname: __dirname }); } - async run (message, args, data) { - const newBio = args.join(" "); + async run (interaction, translate, data) { + const newBio = interaction.options.getString("bio"); if(!newBio){ - return message.error("economy/setbio:MISSING"); + return interaction.reply({ + content: translate("economy/setbio:MISSING"), + ephemeral: true + }); } if(newBio.length > 100){ - return message.error("economy/setbio:MAX_CHARACT"); + return interaction.reply({ + content: translate("economy/setbio:MAX_CHARACT"), + ephemeral: true + }); } data.userData.bio = newBio; - message.success("economy/setbio:SUCCESS"); + interaction.reply({ + content: translate("economy/setbio:SUCCESS") + }); await data.userData.save(); } -} - -module.exports = Setbio; \ No newline at end of file +}; diff --git a/commands/Economy/slots.js b/commands/Economy/slots.js index bb9046840b..3779f3426c 100644 --- a/commands/Economy/slots.js +++ b/commands/Economy/slots.js @@ -1,43 +1,54 @@ const Command = require("../../base/Command.js"); +const Emojis = require("../../emojis.json"); -class Slots extends Command { +module.exports = class extends Command { constructor (client) { super(client, { name: "slots", - dirname: __dirname, + + options: [ + { + name: "amount", + type: "INTEGER" + } + ], + enabled: true, guildOnly: true, - aliases: [ "casino", "slot" ], memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, ownerOnly: false, - cooldown: 3000 + + dirname: __dirname }); } - async run (message, args, data) { + async run (interaction, translate, data) { const fruits = [ "🍎", "🍐", "🍌", "πŸ‡", "πŸ‰", "πŸ’", "πŸ“" ]; let i1=0,j1=0,k1=0,i2=1,j2=1,k2=1,i3=2,j3=2,k3=2; // Gets three random fruits array - const colonnes = [ + const columns = [ this.client.functions.shuffle(fruits), this.client.functions.shuffle(fruits), this.client.functions.shuffle(fruits) ]; // Gets the amount provided - let amount = args[0]; + let amount = interaction.options.getInteger("amount"); if(!amount || isNaN(amount) || amount < 1){ amount = 1; } if(amount > data.memberData.money){ - return message.error("economy/slots:NOT_ENOUGH", { - money: amount + return interaction.reply({ + content: translate("economy/slots:NOT_ENOUGH", { + money: amount + }), + ephemeral: true }); } amount = Math.round(amount); @@ -52,8 +63,8 @@ class Slots extends Command { return Math.round(number); } - const tmsg = await message.sendT("misc:loading", null, { - prefixEmoji: "loading" + const tmsg = await interaction.reply({ + content: Emojis.loading + " | " + translate("misc:loading") }); editMsg(); const interval = setInterval(editMsg, 1000); @@ -76,18 +87,18 @@ 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 += columns[0][i1] + " : " + columns[1][j1] + " : "+ columns[2][k1] + "\n"; + msg += columns[0][i2] + " : " + columns[1][j2] + " : "+ columns[2][k2] + " **<**\n"; + msg += columns[0][i3] + " : " + columns[1][j3] + " : "+ columns[2][k3] + "\n------------------\n"; - if((colonnes[0][i2] == colonnes[1][j2]) && (colonnes[1][j2] == colonnes[2][k2])){ - msg += "| : : : **"+(message.translate("common:VICTORY").toUpperCase())+"** : : : |"; + if((columns[0][i2] == columns[1][j2]) && (columns[1][j2] == columns[2][k2])){ + msg += "| : : : **"+(translate("common:VICTORY").toUpperCase())+"** : : : |"; tmsg.edit(msg); const credits = getCredits(amount, true); - message.channel.send("**!! JACKPOT !!**\n"+message.translate("economy/slots:VICTORY", { + interaction.channel.send("**!! JACKPOT !!**\n"+translate("economy/slots:VICTORY", { money: amount, won: credits, - username: message.author.username + username: interaction.user.username })); const toAdd = credits - amount; data.memberData.money = data.memberData.money + toAdd; @@ -95,7 +106,7 @@ class Slots extends Command { data.userData.achievements.slots.progress.now += 1; if(data.userData.achievements.slots.progress.now === data.userData.achievements.slots.progress.total){ data.userData.achievements.slots.achieved = true; - message.channel.send({ files: [ { name: "unlocked.png", attachment: "./assets/img/achievements/achievement_unlocked4.png" } ] }); + interaction.channel.send({ files: [ { name: "unlocked.png", attachment: "./assets/img/achievements/achievement_unlocked4.png" } ] }); } data.userData.markModified("achievements.slots"); await data.userData.save(); @@ -104,14 +115,14 @@ class Slots extends Command { return; } - 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())+"** : : : |"; + if(columns[0][i2] == columns[1][j2] || columns[1][j2] == columns[2][k2] || columns[0][i2] == columns[2][k2]){ + msg += "| : : : **"+(translate("common:VICTORY").toUpperCase())+"** : : : |"; tmsg.edit(msg); const credits = getCredits(amount, false); - message.channel.send(message.translate("economy/slots:VICTORY", { + interaction.channel.send(translate("economy/slots:VICTORY", { money: amount, won: credits, - username: message.author.username + username: interaction.user.username })); const toAdd = credits - amount; data.memberData.money = data.memberData.money + toAdd; @@ -119,7 +130,7 @@ class Slots extends Command { data.userData.achievements.slots.progress.now += 1; if(data.userData.achievements.slots.progress.now === data.userData.achievements.slots.progress.total){ data.userData.achievements.slots.achieved = true; - message.channel.send({ files: [ { name: "unlocked.png", attachment: "./assets/img/achievements/achievement_unlocked4.png" } ] }); + interaction.channel.send({ files: [ { name: "unlocked.png", attachment: "./assets/img/achievements/achievement_unlocked4.png" } ] }); } data.userData.markModified("achievements.slots"); await data.userData.save(); @@ -128,10 +139,10 @@ class Slots extends Command { return; } - msg += "| : : : **"+(message.translate("common:DEFEAT").toUpperCase())+"** : : : |"; - message.channel.send(message.translate("economy/slots:DEFEAT", { + msg += "| : : : **"+(translate("common:DEFEAT").toUpperCase())+"** : : : |"; + interaction.channel.send(translate("economy/slots:DEFEAT", { money: amount, - username: message.author.username + username: interaction.user.username })); data.memberData.money = data.memberData.money - amount; if(!data.userData.achievements.slots.achieved){ @@ -157,14 +168,12 @@ 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"; + msg += columns[0][i1] + " : " + columns[1][j1] + " : "+ columns[2][k1] + "\n"; + msg += columns[0][i2] + " : " + columns[1][j2] + " : "+ columns[2][k2] + " **<**\n"; + msg += columns[0][i3] + " : " + columns[1][j3] + " : "+ columns[2][k3] + "\n"; tmsg.edit(msg); } } -} - -module.exports = Slots; \ No newline at end of file +}; diff --git a/commands/Economy/withdraw.js b/commands/Economy/withdraw.js index d68a527783..626ec898aa 100644 --- a/commands/Economy/withdraw.js +++ b/commands/Economy/withdraw.js @@ -1,42 +1,47 @@ const Command = require("../../base/Command.js"); -class Withdraw extends Command { +module.exports = class extends Command { constructor (client) { super(client, { name: "withdraw", - dirname: __dirname, + + options: [ + { + name: "amount", + type: "INTEGER", + required: true + } + ], + enabled: true, guildOnly: true, - aliases: [ "wd" ], memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, ownerOnly: false, - cooldown: 1000 + + dirname: __dirname }); } - async run (message, args, data) { + async run (interaction, translate, data) { - let amount = args[0]; + const amount = interaction.options.getInteger("amount"); if(!(parseInt(data.memberData.bankSold, 10) > 0)) { - return message.error("economy/withdraw:NO_CREDIT"); + return interaction.reply({ + content: translate("economy/withdraw:NO_CREDIT"), + ephemeral: true + }); } - if(args[0] === "all"){ - amount = parseInt(data.memberData.bankSold, 10); - } else { - if(isNaN(amount) || parseInt(amount, 10) < 1){ - return message.error("economy/withdraw:MISSING_AMOUNT"); - } - amount = parseInt(amount, 10); - } - if(data.memberData.bankSold < amount){ - return message.error("economy/withdraw:NOT_ENOUGH", { - money: amount + return interaction.reply({ + content: translate("economy/withdraw:NOT_ENOUGH", { + money: amount + }), + ephemeral: true }); } @@ -44,11 +49,11 @@ class Withdraw extends Command { data.memberData.bankSold = data.memberData.bankSold - amount; data.memberData.save(); - message.success("economy/withdraw:SUCCESS", { - money: amount + interaction.reply({ + content: translate("economy/withdraw:SUCCESS", { + money: amount + }) }); } -} - -module.exports = Withdraw; \ No newline at end of file +}; diff --git a/commands/Economy/work.js b/commands/Economy/work.js index 496ad11551..c608320eb7 100644 --- a/commands/Economy/work.js +++ b/commands/Economy/work.js @@ -1,24 +1,24 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"); -class Work extends Command { +module.exports = class extends Command { constructor (client) { super(client, { name: "work", - dirname: __dirname, + enabled: true, guildOnly: true, - aliases: [ "salaire", "salary", "travail", "daily", "dailies" ], memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, ownerOnly: false, - cooldown: 3000 + + dirname: __dirname }); } - async run (message, args, data) { + async run (interaction, translate, data) { // if the member is already in the cooldown db const isInCooldown = data.memberData.cooldowns.work; @@ -27,8 +27,11 @@ class Work extends Command { when the member will be able to execute the order again is greater than the current date, display an error message */ if(isInCooldown > Date.now()){ - return message.error("economy/work:COOLDOWN", { - time: message.convertTime(isInCooldown, "to", true) + return interaction.reply({ + content: translate("economy/work:COOLDOWN", { + time: this.client.convertTime(isInCooldown, "to", true, data.guildData.language) + }), + ephemeral: true }); } } @@ -46,7 +49,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(translate("economy/work:AWARD"), interaction.user.displayAvatarURL({ size: 512, dynamic: true, format: "png" })) .setColor(data.config.embed.color); const award = [ @@ -60,10 +63,10 @@ class Work extends Command { if(data.memberData.workStreak >= 5){ won += 200; - embed.addField(message.translate("economy/work:SALARY"), message.translate("economy/work:SALARY_CONTENT", { + embed.addField(translate("economy/work:SALARY"), translate("economy/work:SALARY_CONTENT", { won })) - .addField(message.translate("economy/work:STREAK"), message.translate("economy/work:STREAK_CONTENT")); + .addField(translate("economy/work:STREAK"), translate("economy/work:STREAK_CONTENT")); data.memberData.workStreak = 0; } else { for(let i = 0; i < award.length; i++){ @@ -72,10 +75,10 @@ class Work extends Command { award[i] = `:regional_indicator_${letter.toLowerCase()}:`; } } - embed.addField(message.translate("economy/work:SALARY"), message.translate("economy/work:SALARY_CONTENT", { + embed.addField(translate("economy/work:SALARY"), translate("economy/work:SALARY_CONTENT", { won })) - .addField(message.translate("economy/work:STREAK"), award.join("")); + .addField(translate("economy/work:STREAK"), award.join("")); } data.memberData.money = data.memberData.money + won; @@ -98,10 +101,8 @@ class Work extends Command { } // Send the embed in the current channel - message.channel.send(messageOptions); + interaction.channel.send(messageOptions); } -} - -module.exports = Work; +}; diff --git a/commands/Fun/8ball.js b/commands/Fun/8ball.js index 563003d713..13f1eeb03e 100644 --- a/commands/Fun/8ball.js +++ b/commands/Fun/8ball.js @@ -1,6 +1,6 @@ const Command = require("../../base/Command.js"); -class Eightball extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -8,7 +8,7 @@ class Eightball extends Command { dirname: __dirname, enabled: true, guildOnly: false, - aliases: [ "eight-ball", "eightball" ], + memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -17,18 +17,19 @@ class Eightball extends Command { }); } - async run (message, args) { + async run (interaction, translate) { if (!args[0] || !message.content.endsWith("?")) { - return message.error("fun/8ball:ERR_QUESTION"); + return interaction.reply({ + content: translate("fun/8ball:ERR_QUESTION"), + ephemeral: true + }); } const answerNO = parseInt(Math.floor(Math.random() * 10), 10); - const answer = message.translate(`fun/8ball:RESPONSE_${answerNO + 1}`); + const answer = translate(`fun/8ball:RESPONSE_${answerNO + 1}`); - message.channel.send(`${message.author.username}, ${answer}`); + message.channel.send(`${interaction.user.username}, ${answer}`); } -} - -module.exports = Eightball; \ No newline at end of file +}; diff --git a/commands/Fun/ascii.js b/commands/Fun/ascii.js index bc7392d031..8977208aeb 100644 --- a/commands/Fun/ascii.js +++ b/commands/Fun/ascii.js @@ -3,7 +3,7 @@ const Command = require("../../base/Command.js"), util = require("util"), figletAsync = util.promisify(figlet); -class Ascii extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -11,7 +11,7 @@ class Ascii extends Command { dirname: __dirname, enabled: true, guildOnly: false, - aliases: [], + , memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -20,10 +20,13 @@ class Ascii extends Command { }); } - async run (message, args) { + async run (interaction, translate) { const text = args.join(" "); if (!text || text.length > 20) { - return message.error("fun/ascii:TEXT_MISSING"); + return interaction.reply({ + content: translate("fun/ascii:TEXT_MISSING"), + ephemeral: true + }); } const rendered = await figletAsync(text); @@ -31,6 +34,4 @@ class Ascii extends Command { } -} - -module.exports = Ascii; \ No newline at end of file +}; diff --git a/commands/Fun/choice.js b/commands/Fun/choice.js index 069b1df0f4..35f1f59465 100644 --- a/commands/Fun/choice.js +++ b/commands/Fun/choice.js @@ -1,6 +1,6 @@ const Command = require("../../base/Command.js"); -class Choice extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -8,7 +8,7 @@ class Choice extends Command { dirname: __dirname, enabled: true, guildOnly: false, - aliases: [ "random" ], + memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -17,13 +17,19 @@ class Choice extends Command { }); } - async run (message, args) { + async run (interaction, translate) { // Gets the answers by spliting on "/" const answers = args.join(" ").split("/"); - if (answers.length < 2) return message.error("fun/choice:MISSING"); + if (answers.length < 2) return interaction.reply({ + content: translate("fun/choice:MISSING"), + ephemeral: true + }); if (answers.some(answer => !answer)) - return message.error("fun/choice:EMPTY"); + return interaction.reply({ + content: translate("fun/choice:EMPTY"), + ephemeral: true + }); const m = await message.sendT( "fun/choice:PROGRESS", @@ -44,6 +50,4 @@ class Choice extends Command { } -} - -module.exports = Choice; \ No newline at end of file +}; diff --git a/commands/Fun/findwords.js b/commands/Fun/findwords.js index f3109d4e42..fb1c11eabb 100644 --- a/commands/Fun/findwords.js +++ b/commands/Fun/findwords.js @@ -3,7 +3,7 @@ const Command = require("../../base/Command.js"), const currentGames = {}; -class FindWords extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -11,7 +11,7 @@ class FindWords extends Command { dirname: __dirname, enabled: true, guildOnly: true, - aliases: [], + , memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -20,10 +20,13 @@ class FindWords extends Command { }); } - async run (message, args, data) { + async run (interaction, translate, data) { - if (currentGames[message.guild.id]) { - return message.error("fun/number:GAME_RUNNING"); + if (currentGames[interaction.guild.id]) { + return interaction.reply({ + content: translate("fun/number:GAME_RUNNING"), + ephemeral: true + }); } // Reads words file const wordList = require("../../assets/json/words/"+message.guild.data.language+".json"); @@ -43,7 +46,7 @@ class FindWords extends Command { } let i = 0; // Inits i variable to count games - currentGames[message.guild.id] = true; // Update current game variable + currentGames[interaction.guild.id] = true; // Update current game variable generateGame.call(this, words[i]); // Generate a new round function generateGame(word){ @@ -52,7 +55,9 @@ class FindWords extends Command { // Launch timer const delay = (i === 0) ? 10000 : 0; if(i === 0){ - message.sendT("fun/findwords:GAME_STARTING"); + interaction.reply({ + content: translate("fun/findwords:GAME_STARTING") + }); } setTimeout(() => { @@ -82,7 +87,10 @@ class FindWords extends Command { collector.on("end", async (collected, reason) => { if(reason === "time"){ - message.error("fun/findwords:NO_WINNER"); + interaction.reply({ + content: translate("fun/findwords:NO_WINNER"), + ephemeral: true + }); } else { message.success("fun/findwords:WORD_FOUND", { winner: "<@"+reason+">" @@ -93,9 +101,12 @@ class FindWords extends Command { i++; generateGame.call(this, words[i]); } else { - currentGames[message.guild.id] = false; + currentGames[interaction.guild.id] = false; if(winners.length < 1){ - return message.error("fun/findwords:NO_WINNER_ALL"); + return interaction.reply({ + content: translate("fun/findwords:NO_WINNER_ALL"), + ephemeral: true + }); } const winnerID = await getWinner(winners); const time = message.convertTime(createdAt, "from", true); @@ -106,11 +117,11 @@ class FindWords extends Command { participantCount: participants.length, participantList: participants.map((p) => "<@"+p+">").join("\n") }); - if(participants.length > 1 && data.guild.disabledCategories && !data.guild.disabledCategories.includes("Economy")){ + if(participants.length > 1 && data.guildData.disabledCategories && !data.guildData.disabledCategories.includes("Economy")){ message.sendT("fun/findwords:CREDITS", { winner: user.username }); - const userdata = await this.client.findOrCreateMember({ id: user.id, guildID: message.guild.id }); + const userdata = await this.client.findOrCreateMember({ id: user.id, guildID: interaction.guild.id }); userdata.money = userdata.money + 15; userdata.save(); } @@ -141,6 +152,4 @@ class FindWords extends Command { } } -} - -module.exports = FindWords; \ No newline at end of file +}; diff --git a/commands/Fun/flip.js b/commands/Fun/flip.js index 50d4d0d27e..c14757e193 100644 --- a/commands/Fun/flip.js +++ b/commands/Fun/flip.js @@ -1,6 +1,6 @@ const Command = require("../../base/Command.js"); -class Flip extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -8,7 +8,7 @@ class Flip extends Command { dirname: __dirname, enabled: true, guildOnly: false, - aliases: [ "dice" ], + memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -20,10 +20,13 @@ class Flip extends Command { async run (message) { const isHeads = Math.random() > 0.5; isHeads - ? message.sendT("fun/flip:HEADS") - : message.sendT("fun/flip:TAILS"); + ? interaction.reply({ +content: translate("fun/flip:HEADS") +}); + : interaction.reply({ +content: translate("fun/flip:TAILS") +});; } } -module.exports = Flip; \ No newline at end of file diff --git a/commands/Fun/fml.js b/commands/Fun/fml.js index b18435ec06..b5aa698d62 100644 --- a/commands/Fun/fml.js +++ b/commands/Fun/fml.js @@ -1,7 +1,7 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"); -class Fml extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -9,7 +9,7 @@ class Fml extends Command { dirname: __dirname, enabled: true, guildOnly: false, - aliases: [ "vdm" ], + memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -18,22 +18,23 @@ class Fml extends Command { }); } - async run (message, args, data) { + async run (interaction, translate, data) { if (!this.client.config.apiKeys.blagueXYZ) - return message.error("misc:COMMAND_DISABLED"); + return interaction.reply({ + content: translate("misc:COMMAND_DISABLED"), + ephemeral: true + }); - const fml = await this.client.joker.randomVDM(null, data.guild.language.substr(0, 2)); + const fml = await this.client.joker.randomVDM(null, data.guildData.language.substr(0, 2)); const embed = new Discord.MessageEmbed() .setDescription(fml.content) - .setFooter(message.translate("fun/fml:FOOTER")) + .setFooter(translate("fun/fml:FOOTER")) .setColor(this.client.config.embed.color); message.channel.send({ embeds: [embed] }); } -} - -module.exports = Fml; +}; diff --git a/commands/Fun/joke.js b/commands/Fun/joke.js index f35819d66e..0a9de6a1c6 100644 --- a/commands/Fun/joke.js +++ b/commands/Fun/joke.js @@ -1,7 +1,7 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"); -class Joke extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -9,7 +9,7 @@ class Joke extends Command { dirname: __dirname, enabled: true, guildOnly: false, - aliases: [ "blague" ], + memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -18,24 +18,25 @@ class Joke extends Command { }); } - async run (message, args, data) { + async run (interaction, translate, data) { if (!this.client.config.apiKeys.blagueXYZ) - return message.error("misc:COMMAND_DISABLED"); + return interaction.reply({ + content: translate("misc:COMMAND_DISABLED"), + ephemeral: true + }); const joke = await this.client.joker.randomJoke( - data.guild.language.substr(0, 2) + data.guildData.language.substr(0, 2) ); const embed = new Discord.MessageEmbed() .setDescription(joke.toDiscordSpoils()) - .setFooter(message.translate("fun/joke:FOOTER")) + .setFooter(translate("fun/joke:FOOTER")) .setColor(this.client.config.embed.color); message.channel.send({ embeds: [embed] }); } -} - -module.exports = Joke; \ No newline at end of file +}; diff --git a/commands/Fun/lmg.js b/commands/Fun/lmg.js index 184fd88611..661bc085ff 100644 --- a/commands/Fun/lmg.js +++ b/commands/Fun/lmg.js @@ -1,6 +1,6 @@ const Command = require("../../base/Command.js"); -class Lmg extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -8,7 +8,7 @@ class Lmg extends Command { dirname: __dirname, enabled: true, guildOnly: false, - aliases: [ "lmgtfy" ], + memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -17,14 +17,15 @@ class Lmg extends Command { }); } - async run (message, args) { + async run (interaction, translate) { const question = args.join(" "); - if (!question) return message.error("fun/lmg:MISSING"); + if (!question) return interaction.reply({ + content: translate("fun/lmg:MISSING"), + ephemeral: true + }); const encodedQuestion = question.replace(/[' '_]/g, "+"); await message.channel.send(`http://lmgtfy.com/?q=${encodedQuestion}`); message.delete().catch(() => {}); } -} - -module.exports = Lmg; \ No newline at end of file +}; diff --git a/commands/Fun/lovecalc.js b/commands/Fun/lovecalc.js index 5c44292a13..9c9584d1de 100644 --- a/commands/Fun/lovecalc.js +++ b/commands/Fun/lovecalc.js @@ -2,7 +2,7 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"), md5 = require("md5"); -class Lovecalc extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -20,16 +20,22 @@ class Lovecalc extends Command { } async run (message) { - const firstMember = message.mentions.members.filter(m => m.id !== message.author.id).first(); + const firstMember = message.mentions.members.filter(m => m.id !== interaction.user.id).first(); if (!firstMember) - return message.error("fun/lovecalc:MISSING"); + return interaction.reply({ + content: translate("fun/lovecalc:MISSING"), + ephemeral: true + }); const secondMember = message.mentions.members .filter(m => m.id !== firstMember.id) - .filter(m => m.id !== message.author.id) + .filter(m => m.id !== interaction.user.id) .first() || message.member; if (!secondMember) - return message.error("fun/lovecalc:MISSING"); + return interaction.reply({ + content: translate("fun/lovecalc:MISSING"), + ephemeral: true + }); const members = [firstMember, secondMember].sort( (a, b) => parseInt(a.id, 10) - parseInt(b.id, 10) @@ -47,7 +53,7 @@ class Lovecalc extends Command { const embed = new Discord.MessageEmbed() .setAuthor("❀️ LoveCalc") .setDescription( - message.translate("fun/lovecalc:CONTENT", { + translate("fun/lovecalc:CONTENT", { percent, firstUsername: firstMember.user.username, secondUsername: secondMember.user.username @@ -60,6 +66,4 @@ class Lovecalc extends Command { } -} - -module.exports = Lovecalc; +}; diff --git a/commands/Fun/number.js b/commands/Fun/number.js index f86eb37923..3f3c24d5ed 100644 --- a/commands/Fun/number.js +++ b/commands/Fun/number.js @@ -3,7 +3,7 @@ const Command = require("../../base/Command.js"), const currentGames = {}; -class Number extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -11,7 +11,7 @@ class Number extends Command { dirname: __dirname, enabled: true, guildOnly: true, - aliases: [], + , memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -22,14 +22,19 @@ class Number extends Command { async run (message) { - if (currentGames[message.guild.id]) { - return message.error("fun/number:GAME_RUNNING"); + if (currentGames[interaction.guild.id]) { + return interaction.reply({ + content: translate("fun/number:GAME_RUNNING"), + ephemeral: true + }); } const participants = []; const number = Math.floor(Math.random() * 3000); - await message.sendT("fun/number:GAME_START"); + await interaction.reply({ + content: translate("fun/number:GAME_START") + }); // Store the date wich the game has started const gameCreatedAt = Date.now(); @@ -41,7 +46,7 @@ class Number extends Command { time: 480000 // 8 minutes } ); - currentGames[message.guild.id] = true; + currentGames[interaction.guild.id] = true; collector.on("collect", async msg => { if (!participants.includes(msg.author.id)) { @@ -67,7 +72,7 @@ class Number extends Command { message.sendT("fun/number:WON", { winner: msg.author.toString() }); - const userdata = await this.client.findOrCreateMember({ id: msg.author.id, guildID: message.guild.id }); + const userdata = await this.client.findOrCreateMember({ id: msg.author.id, guildID: interaction.guild.id }); userdata.money = userdata.money + 10; userdata.save(); collector.stop(msg.author.username); @@ -87,13 +92,14 @@ class Number extends Command { }); collector.on("end", (_collected, reason) => { - delete currentGames[message.guild.id]; + delete currentGames[interaction.guild.id]; if (reason === "time") { - return message.error("fun/number:DEFEAT", { number }); + return interaction.reply({ + content: translate("fun/number:DEFEAT", { number }), + ephemeral: true + }); } }); } -} - -module.exports = Number; +}; diff --git a/commands/General/fortnite.js b/commands/General/fortnite.js index 52e8de1656..07d6097691 100644 --- a/commands/General/fortnite.js +++ b/commands/General/fortnite.js @@ -2,14 +2,14 @@ const Command = require("../../base/Command.js"), Canvas = require("discord-canvas"), Discord = require("discord.js"); -class Fortnite extends Command { +module.exports = class extends Command { constructor (client) { super(client, { name: "fortnite", dirname: __dirname, enabled: true, guildOnly: false, - aliases: [ "fn" ], + memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -18,22 +18,30 @@ class Fortnite extends Command { }); } - async run (message, args, data) { + async run (interaction, translate, data) { if(!data.config.apiKeys.fortniteTRN || data.config.apiKeys.fortniteTRN.length === ""){ - return message.success("misc:COMMAND_DISABLED"); + return interaction.reply({ + content: translate("misc:COMMAND_DISABLED") + }); } const stats = new Canvas.FortniteStats(); const platform = args[0]; if(!platform || (platform !== "pc" && platform !== "xbl" && platform !== "psn")){ - return message.error("general/fortnite:MISSING_PLATFORM"); + return interaction.reply({ + content: translate("general/fortnite:MISSING_PLATFORM"), + ephemeral: true + }); } const user = args.slice(1).join(" "); if(!user){ - return message.error("general/fortnite:MISSING_USERNAME"); + return interaction.reply({ + content: translate("general/fortnite:MISSING_USERNAME"), + ephemeral: true + }); } const m = await message.sendT("misc:PLEASE_WAIT", null, { @@ -44,18 +52,18 @@ class Fortnite extends Command { .setToken(data.config.apiKeys.fortniteTRN) .setUser(user) .setPlatform(platform) - .setText("averageKills", message.translate("general/fortnite:AVERAGE_KILLS")) - .setText("averageKill", message.translate("general/fortnite:AVERAGE_KILL")) - .setText("wPercent", message.translate("general/fortnite:W_PERCENT")) - .setText("winPercent", message.translate("general/fortnite:WIN_PERCENT")) - .setText("kD", message.translate("general/fortnite:KD")) - .setText("wins", message.translate("general/fortnite:WINS")) - .setText("win", message.translate("general/fortnite:WIN")) - .setText("kills", message.translate("general/fortnite:KILLS")) - .setText("kill", message.translate("general/fortnite:KILL")) - .setText("matches", message.translate("general/fortnite:MATCHES")) - .setText("match", message.translate("general/fortnite:MATCH")) - .setText("footer", message.translate("general/fortnite:FOOTER")) + .setText("averageKills", translate("general/fortnite:AVERAGE_KILLS")) + .setText("averageKill", translate("general/fortnite:AVERAGE_KILL")) + .setText("wPercent", translate("general/fortnite:W_PERCENT")) + .setText("winPercent", translate("general/fortnite:WIN_PERCENT")) + .setText("kD", translate("general/fortnite:KD")) + .setText("wins", translate("general/fortnite:WINS")) + .setText("win", translate("general/fortnite:WIN")) + .setText("kills", translate("general/fortnite:KILLS")) + .setText("kill", translate("general/fortnite:KILL")) + .setText("matches", translate("general/fortnite:MATCHES")) + .setText("match", translate("general/fortnite:MATCH")) + .setText("footer", translate("general/fortnite:FOOTER")) .toAttachment(); if(!statsImage){ @@ -69,7 +77,7 @@ class Fortnite extends Command { // Send embed const attachment = new Discord.MessageAttachment(statsImage.toBuffer(), "fortnite-stats-image.png"), embed = new Discord.MessageEmbed() - .setDescription(message.translate("general/fortnite:TITLE", { + .setDescription(translate("general/fortnite:TITLE", { username: `[${stats.data.username}](${stats.data.url.replace(new RegExp(" ", "g"), "%20")})` })) .attachFiles(attachment) @@ -79,6 +87,4 @@ class Fortnite extends Command { message.channel.send({ embeds: [embed] }); m.delete(); } -} - -module.exports = Fortnite; +}; diff --git a/commands/General/fortniteshop.js b/commands/General/fortniteshop.js index 06a5762bcf..94c17631cc 100644 --- a/commands/General/fortniteshop.js +++ b/commands/General/fortniteshop.js @@ -2,14 +2,14 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"), Canvas = require("discord-canvas"); -class Fortniteshop extends Command { +module.exports = class extends Command { constructor (client) { super(client, { name: "fortniteshop", dirname: __dirname, enabled: true, guildOnly: false, - aliases: [ "fnshop" ], + memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -18,7 +18,7 @@ class Fortniteshop extends Command { }); } - async run(message, args, data) { + async run(interaction, translate, data) { if(!data.config.apiKeys.fortniteFNBR || data.config.apiKeys.fortniteFNBR.length === "") { return message.error("misc:COMMAND_DISABLED"); @@ -28,25 +28,25 @@ class Fortniteshop extends Command { prefixEmoji: "loading" }); - const momentName = this.client.languages.find((language) => language.name === data.guild.language || language.aliases.includes(data.guild.language)).moment; + const momentName = this.client.languages.find((language) => language.name === data.guildData.language || language.aliases.includes(data.guildData.language)).moment; const shop = new Canvas.FortniteShop(); const image = await shop .setToken(data.config.apiKeys.fortniteFNBR) - .setText("header", message.translate("general/fortniteshop:HEADER")) - .setText("daily", message.translate("general/fortniteshop:DAILY")) - .setText("featured", message.translate("general/fortniteshop:FEATURED")) - .setText("date", message.translate("general/fortniteshop:DATE", { + .setText("header", translate("general/fortniteshop:HEADER")) + .setText("daily", translate("general/fortniteshop:DAILY")) + .setText("featured", translate("general/fortniteshop:FEATURED")) + .setText("date", translate("general/fortniteshop:DATE", { skipInterpolation: true }).replace("{{date}}", "{date}")) - .setText("footer", message.translate("general/fortniteshop:FOOTER")) + .setText("footer", translate("general/fortniteshop:FOOTER")) .lang(momentName) .toAttachment(); const attachment = new Discord.MessageAttachment(image, "shop.png"); const embed = new Discord.MessageEmbed() - .setAuthor(message.translate("general/fortniteshop:HEADER", { + .setAuthor(translate("general/fortniteshop:HEADER", { date: message.printDate(new Date(Date.now())) - }), this.client.user.displayAvatarURL({ size: 512, dynamic: true, format: 'png' })) + }), this.client.user.displayAvatarURL({ size: 512, dynamic: true, format: "png" })) .attachFiles(attachment) .setImage("attachment://shop.png") .setColor(this.client.config.embed.color) @@ -56,6 +56,4 @@ class Fortniteshop extends Command { return; } -} - -module.exports = Fortniteshop; +}; diff --git a/commands/General/github.js b/commands/General/github.js index bf54661931..02a68b49dd 100644 --- a/commands/General/github.js +++ b/commands/General/github.js @@ -2,7 +2,7 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"), fetch = require("node-fetch"); -class Github extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -10,7 +10,7 @@ class Github extends Command { dirname: __dirname, enabled: true, guildOnly: false, - aliases: [ "git", "code" ], + memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -19,18 +19,18 @@ class Github extends Command { }); } - async run (message, args, data) { + async run (interaction, translate, data) { const res = await fetch("https://api.github.com/repos/Androz2091/AtlantaBot"); 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/Androz2091/AtlantaBot)") + .setAuthor(this.client.user.tag, this.client.user.displayAvatarURL({ size: 512, dynamic: true, format: "png" })) + .setDescription("["+translate("general/github:CLICK_HERE")+"](https://github.com/Androz2091/AtlantaBot)") .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(translate("general/github:LANGUAGE"), json.language, true) + .addField(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); @@ -38,6 +38,4 @@ class Github extends Command { message.channel.send({ embeds: [embed] }); } -} - -module.exports = Github; \ No newline at end of file +}; diff --git a/commands/General/hastebin.js b/commands/General/hastebin.js index 41db9554b0..193a8c33d0 100644 --- a/commands/General/hastebin.js +++ b/commands/General/hastebin.js @@ -2,7 +2,7 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"), fetch = require("node-fetch"); -class Hastebin extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -10,7 +10,7 @@ class Hastebin extends Command { dirname: __dirname, enabled: true, guildOnly: false, - aliases: [ "pastebin" ], + memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -19,11 +19,14 @@ class Hastebin extends Command { }); } - async run (message, args, data) { + async run (interaction, translate, data) { const content = args.join(" "); if(!content){ - return message.error("general/hastebin:MISSING_TEXT"); + return interaction.reply({ + content: translate("general/hastebin:MISSING_TEXT"), + ephemeral: true + }); } try { @@ -35,21 +38,25 @@ class Hastebin extends Command { const json = await res.json(); if(!json.key){ - return message.error("misc:ERR_OCCURRED"); + return interaction.reply({ + content: translate("misc:ERR_OCCURRED"), + ephemeral: true + }); } const url = "https://hastebin.com/"+json.key+".js"; const embed = new Discord.MessageEmbed() - .setAuthor(message.translate("general/hastebin:SUCCESS")) + .setAuthor(translate("general/hastebin:SUCCESS")) .setDescription(url) .setColor(data.config.embed.color); message.channel.send({ embeds: [embed] }); } catch(e){ - message.error("misc:ERR_OCCURRED"); + interaction.reply({ + content: translate("misc:ERR_OCCURRED"), + ephemeral: true + }); } } -} - -module.exports = Hastebin; +}; diff --git a/commands/General/help.js b/commands/General/help.js index 0713b651fa..76a53cf1d9 100644 --- a/commands/General/help.js +++ b/commands/General/help.js @@ -1,14 +1,14 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"); -class Help extends Command { +module.exports = class extends Command { constructor (client) { super(client, { name: "help", dirname: __dirname, enabled: true, guildOnly: false, - aliases: [ "aide", "h", "commands" ], + memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -17,12 +17,12 @@ class Help extends Command { }); } - async run (message, args, data) { + async run (interaction, translate, data) { // if a command is provided if(args[0]){ - const isCustom = (message.guild && data.guild.customCommands ? data.guild.customCommands.find((c) => c.name === args[0]) : false); + const isCustom = (message.guild && data.guildData.customCommands ? data.guildData.customCommands.find((c) => c.name === args[0]) : false); // if the command doesn't exist, error message const cmd = this.client.commands.get(args[0]) || this.client.commands.get(this.client.aliases.get(args[0])); @@ -36,16 +36,16 @@ class Help extends Command { }); } - const description = message.translate(`${cmd.help.category.toLowerCase()}/${cmd.help.name}:DESCRIPTION`); - const usage = message.translate(`${cmd.help.category.toLowerCase()}/${cmd.help.name}:USAGE`, { + const description = translate(`${cmd.help.category.toLowerCase()}/${cmd.help.name}:DESCRIPTION`); + const usage = translate(`${cmd.help.category.toLowerCase()}/${cmd.help.name}:USAGE`, { prefix: message.guild - ? data.guild.prefix + ? data.guildData.prefix : "" } ); - const examples = message.translate(`${cmd.help.category.toLowerCase()}/${cmd.help.name}:EXAMPLES`, { + const examples = translate(`${cmd.help.category.toLowerCase()}/${cmd.help.name}:EXAMPLES`, { prefix: message.guild - ? data.guild.prefix + ? data.guildData.prefix : "" } ); @@ -53,33 +53,33 @@ class Help extends Command { // Creates the help embed const groupEmbed = new Discord.MessageEmbed() .setAuthor( - message.translate("general/help:CMD_TITLE", { + translate("general/help:CMD_TITLE", { prefix: message.guild - ? data.guild.prefix + ? data.guildData.prefix : "", cmd: cmd.help.name }) ) .addField( - message.translate("general/help:FIELD_DESCRIPTION"), + translate("general/help:FIELD_DESCRIPTION"), description ) - .addField(message.translate("general/help:FIELD_USAGE"), usage) + .addField(translate("general/help:FIELD_USAGE"), usage) .addField( - message.translate("general/help:FIELD_EXAMPLES"), + translate("general/help:FIELD_EXAMPLES"), examples ) .addField( - message.translate("general/help:FIELD_ALIASES"), + translate("general/help:FIELD_ALIASES"), cmd.help.aliases.length > 0 ? cmd.help.aliases.map(a => "`" + a + "`").join("\n") - : message.translate("general/help:NO_ALIAS") + : translate("general/help:NO_ALIAS") ) .addField( - message.translate("general/help:FIELD_PERMISSIONS"), + 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") + : translate("general/help:NO_REQUIRED_PERMISSION") ) .setColor(this.client.config.embed.color) .setFooter(this.client.config.embed.footer); @@ -93,7 +93,7 @@ class Help extends Command { commands.forEach((command) => { if(!categories.includes(command.help.category)){ - if(command.help.category === "Owner" && message.author.id !== this.client.config.owner.id){ + if(command.help.category === "Owner" && interaction.user.id !== this.client.config.owner.id){ return; } categories.push(command.help.category); @@ -103,9 +103,9 @@ class Help extends Command { const emojis = this.client.customEmojis; const embed = new Discord.MessageEmbed() - .setDescription(message.translate("general/help:INFO", { + .setDescription(translate("general/help:INFO", { prefix: message.guild - ? data.guild.prefix + ? data.guildData.prefix : "" })) .setColor(data.config.embed.color) @@ -115,12 +115,12 @@ 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.guildData.customCommands.length > 0){ + embed.addField(emojis.categories.custom+" "+message.guild.name+" | "+translate("general/help:CUSTOM_COMMANDS")+" - ("+data.guildData.customCommands.length+")", data.guildData.customCommands.map((cmd) => "`"+cmd.name+"`").join(", ")); } } - embed.addField("\u200B", message.translate("misc:STATS_FOOTER", { + embed.addField("\u200B", translate("misc:STATS_FOOTER", { donateLink: "https://patreon.com/Androz2091", dashboardLink: "https://dashboard.atlanta-bot.fr", inviteLink: await this.client.generateInvite({ @@ -129,12 +129,10 @@ class Help extends Command { githubLink: "https://github.com/Androz2091", supportLink: "https://discord.atlanta-bot.fr" })); - embed.setAuthor(message.translate("general/help:TITLE", { + embed.setAuthor(translate("general/help:TITLE", { name: this.client.user.username }), this.client.user.displayAvatarURL({ size: 512, dynamic: true, format: "png" })); return message.channel.send({ embeds: [embed] }); } -} - -module.exports = Help; +}; diff --git a/commands/General/invitations.js b/commands/General/invitations.js index fb38b1f5ed..9bfc972171 100644 --- a/commands/General/invitations.js +++ b/commands/General/invitations.js @@ -1,7 +1,7 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"); -class Invitations extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -9,7 +9,7 @@ class Invitations extends Command { dirname: __dirname, enabled: true, guildOnly: true, - aliases: [], + , memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "MANAGE_GUILD" ], nsfw: false, @@ -18,20 +18,26 @@ class Invitations extends Command { }); } - async run (message, args, data) { + async run (interaction, translate, data) { let member = await this.client.resolveMember(args[0], message.guild); if (!member) member = message.member; // Gets the invites const invites = await message.guild.fetchInvites().catch(() => {}); - if (!invites) return message.error("misc:ERR_OCCURRED"); + if (!invites) return interaction.reply({ + content: translate("misc:ERR_OCCURRED"), + ephemeral: true + }); const memberInvites = invites.filter((i) => i.inviter && i.inviter.id === member.user.id); if(memberInvites.size <= 0){ if(member === message.member){ - return message.error("general/invitations:NOBODY_AUTHOR"); + return interaction.reply({ + content: translate("general/invitations:NOBODY_AUTHOR"), + ephemeral: true + }); } else { return message.error("general/invitations:NOBODY_MEMBER", { member: member.user.tag @@ -40,7 +46,7 @@ class Invitations extends Command { } const content = memberInvites.map((i) => { - return message.translate("general/invitations:CODE", { + return translate("general/invitations:CODE", { uses: i.uses, code: i.code, channel: i.channel.toString() @@ -52,19 +58,17 @@ class Invitations extends Command { const embed = new Discord.MessageEmbed() .setColor(data.config.embed.color) .setFooter(data.config.embed.footer) - .setAuthor(message.translate("general/invitations:TRACKER")) - .setDescription(message.translate("general/invitations:TITLE", { + .setAuthor(translate("general/invitations:TRACKER")) + .setDescription(translate("general/invitations:TITLE", { member: member.user.tag, guild: message.guild.name })) - .addField(message.translate("general/invitations:FIELD_INVITED"), message.translate("general/invitations:FIELD_MEMBERS", { + .addField(translate("general/invitations:FIELD_INVITED"), translate("general/invitations:FIELD_MEMBERS", { total: index })) - .addField(message.translate("general/invitations:FIELD_CODES"), content); + .addField(translate("general/invitations:FIELD_CODES"), content); message.channel.send({ embeds: [embed] }); } -} - -module.exports = Invitations; +}; diff --git a/commands/General/invite.js b/commands/General/invite.js index 1a0ec04ac1..fd8683ecb1 100644 --- a/commands/General/invite.js +++ b/commands/General/invite.js @@ -1,7 +1,7 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"); -class Invite extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -9,7 +9,7 @@ class Invite extends Command { dirname: __dirname, enabled: true, guildOnly: false, - aliases: [ "i", "add", "vote" ], + memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -18,7 +18,7 @@ class Invite extends Command { }); } - async run (message, args, data) { + async run (interaction, translate, data) { const inviteLink = this.client.config.inviteURL || `https://discordapp.com/oauth2/authorize?client_id=${this.client.user.id}&scope=bot&permissions=2146958847`; const voteURL = this.client.config.voteURL || `https://discordbots.org/bot/${this.client.user.id}/vote`; @@ -29,13 +29,13 @@ class Invite extends Command { } const embed = new Discord.MessageEmbed() - .setAuthor(message.translate("general/invite:LINKS")) - .setDescription(message.translate("general/invite:TIP", { - prefix: data.guild.prefix + .setAuthor(translate("general/invite:LINKS")) + .setDescription(translate("general/invite:TIP", { + prefix: data.guildData.prefix })) - .addField(message.translate("general/invite:ADD"), inviteLink) - .addField(message.translate("general/invite:VOTE"), voteURL) - .addField(message.translate("general/invite:SUPPORT"), supportURL) + .addField(translate("general/invite:ADD"), inviteLink) + .addField(translate("general/invite:VOTE"), voteURL) + .addField(translate("general/invite:SUPPORT"), supportURL) .setColor(data.config.embed.color) .setFooter(data.config.embed.footer); @@ -43,6 +43,4 @@ class Invite extends Command { } -} - -module.exports = Invite; \ No newline at end of file +}; diff --git a/commands/General/minecraft.js b/commands/General/minecraft.js index a890ae6aa0..30bb4c6eaa 100644 --- a/commands/General/minecraft.js +++ b/commands/General/minecraft.js @@ -4,7 +4,7 @@ const Command = require("../../base/Command.js"), gamedig = require("gamedig"), Sentry = require("@sentry/node"); -class Minecraft extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -12,7 +12,7 @@ class Minecraft extends Command { dirname: __dirname, enabled: true, guildOnly: false, - aliases: [ "mc" ], + memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -21,11 +21,14 @@ class Minecraft extends Command { }); } - async run (message, args, data) { + async run (interaction, translate, data) { const ip = args[0]; if(!ip){ - return message.error("general/minecraft:MISSING_IP"); + return interaction.reply({ + content: translate("general/minecraft:MISSING_IP"), + ephemeral: true + }); } const favicon = `https://eu.mc-api.net/v3/server/favicon/${ip}`; @@ -73,24 +76,24 @@ class Minecraft extends Command { const imgAttachment = new Discord.MessageAttachment(await imgRes.buffer(), "success.png"); const mcEmbed = new Discord.MessageEmbed() - .setAuthor(message.translate("general/minecraft:FIELD_NAME", { + .setAuthor(translate("general/minecraft:FIELD_NAME", { ip: json.name })) - .addField(message.translate("general/minecraft:FIELD_VERSION"), + .addField(translate("general/minecraft:FIELD_VERSION"), json.raw.vanilla.raw.version.name ) - .addField(message.translate("general/minecraft:FIELD_CONNECTED"), - message.translate("general/minecraft:PLAYERS", { + .addField(translate("general/minecraft:FIELD_CONNECTED"), + translate("general/minecraft:PLAYERS", { count: (json.raw.players ? json.raw.players.online : json.players.length) }) ) - .addField(message.translate("general/minecraft:FIELD_MAX"), - message.translate("general/minecraft:PLAYERS", { + .addField(translate("general/minecraft:FIELD_MAX"), + translate("general/minecraft:PLAYERS", { count: (json.raw.players ? json.raw.players.max : json.maxplayers) }) ) - .addField(message.translate("general/minecraft:FIELD_STATUS"), message.translate("general/minecraft:ONLINE")) - .addField(message.translate("general/minecraft:FIELD_IP"), json.connect) + .addField(translate("general/minecraft:FIELD_STATUS"), translate("general/minecraft:ONLINE")) + .addField(translate("general/minecraft:FIELD_IP"), json.connect) .setColor(data.config.embed.color) .setThumbnail(favicon) .setFooter(data.config.embed.footer); @@ -99,6 +102,4 @@ class Minecraft extends Command { } -} - -module.exports = Minecraft; \ No newline at end of file +}; diff --git a/commands/General/permissions.js b/commands/General/permissions.js index cb18e2cf46..90cdb74401 100644 --- a/commands/General/permissions.js +++ b/commands/General/permissions.js @@ -2,14 +2,14 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"); const permissions = Object.keys(Discord.Permissions.FLAGS); -class Permissions extends Command { +module.exports = class extends Command { constructor (client) { super(client, { name: "permissions", dirname: __dirname, enabled: true, guildOnly: true, - aliases: [ "perms" ], + memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -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", { + let text = "```\n"+translate("general/permissions:TITLE", { user: member.user.username, channel: message.channel.name })+"\n\n"; @@ -41,6 +41,4 @@ class Permissions extends Command { text += `\n${total.allowed} βœ… | ${total.denied} ❌`+"\n```"; message.channel.send(text); } -} - -module.exports = Permissions; +}; diff --git a/commands/General/ping.js b/commands/General/ping.js index be8559c506..df7638714b 100644 --- a/commands/General/ping.js +++ b/commands/General/ping.js @@ -1,6 +1,6 @@ const Command = require("../../base/Command.js"); -class Ping extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -8,7 +8,7 @@ class Ping extends Command { dirname: __dirname, enabled: true, guildOnly: false, - aliases: [ "pong", "latency" ], + memberPermissions: [], botPermissions: [ "SEND_MESSAGES" ], nsfw: false, @@ -29,6 +29,4 @@ class Ping extends Command { }); } -} - -module.exports = Ping; \ No newline at end of file +}; diff --git a/commands/General/quote.js b/commands/General/quote.js index 05c6d81037..613293572f 100644 --- a/commands/General/quote.js +++ b/commands/General/quote.js @@ -1,7 +1,7 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"); -class Quote extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -9,7 +9,7 @@ class Quote extends Command { dirname: __dirname, enabled: true, guildOnly: true, - aliases: [ "quoter" ], + memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -18,7 +18,7 @@ class Quote extends Command { }); } - async run (message, args, data) { + async run (interaction, translate, data) { function embed(m){ const embed = new Discord.MessageEmbed() @@ -35,10 +35,13 @@ class Quote extends Command { const msgID = args[0]; if(isNaN(msgID)){ - message.author.send(message.translate("general/quote:MISSING_ID")).then(() => { + interaction.user.send(translate("general/quote:MISSING_ID")).then(() => { message.delete(); }).catch(() => { - message.error("misc:CANNOT_DM"); + interaction.reply({ + content: translate("misc:CANNOT_DM"), + ephemeral: true + }); }); return; } @@ -47,10 +50,13 @@ class Quote extends Command { if(args[1] && !channel){ channel = this.client.channels.cache.get(args[1]); if(!channel){ - message.author.send(message.translate("general/quote:NO_MESSAGE_ID")).then(() => { + interaction.user.send(translate("general/quote:NO_MESSAGE_ID")).then(() => { message.delete(); }).catch(() => { - message.error("misc:CANNOT_DM"); + interaction.reply({ + content: translate("misc:CANNOT_DM"), + ephemeral: true + }); }); return; } @@ -58,10 +64,13 @@ class Quote extends Command { if(!channel){ message.channel.messages.fetch(msgID).catch(() => { - message.author.send((message.translate("general/quote:NO_MESSAGE_ID"))).then(() => { + interaction.user.send((translate("general/quote:NO_MESSAGE_ID"))).then(() => { message.delete(); }).catch(() => { - message.error("misc:CANNOT_DM"); + interaction.reply({ + content: translate("misc:CANNOT_DM"), + ephemeral: true + }); }); return; }).then((msg) => { @@ -70,10 +79,13 @@ class Quote extends Command { }); } else { channel.messages.fetch(msgID).catch(() => { - message.author.send(message.translate("general/quote:NO_MESSAGE_ID")).then(() => { + interaction.user.send(translate("general/quote:NO_MESSAGE_ID")).then(() => { message.delete(); }).catch(() => { - message.error("misc:CANNOT_DM"); + interaction.reply({ + content: translate("misc:CANNOT_DM"), + ephemeral: true + }); }); return; }).then((msg) => { @@ -83,6 +95,4 @@ class Quote extends Command { } } -} - -module.exports = Quote; \ No newline at end of file +}; diff --git a/commands/General/remindme.js b/commands/General/remindme.js index 385d43663a..ba0bbd3a41 100644 --- a/commands/General/remindme.js +++ b/commands/General/remindme.js @@ -1,7 +1,7 @@ const Command = require("../../base/Command.js"), ms = require("ms"); -class Remindme extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -9,7 +9,7 @@ class Remindme extends Command { dirname: __dirname, enabled: true, guildOnly: false, - aliases: [ "reminder" ], + memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -17,16 +17,22 @@ class Remindme extends Command { }); } - async run (message, args, data) { + async run (interaction, translate, data) { const time = args[0]; if(!time || isNaN(ms(time))){ - return message.error("misc:INVALID_TIME"); + return interaction.reply({ + content: translate("misc:INVALID_TIME"), + ephemeral: true + }); } const msg = args.slice(1).join(" "); if(!msg){ - return message.error("general/remindme:MISSING_MESSAGE"); + return interaction.reply({ + content: translate("general/remindme:MISSING_MESSAGE"), + ephemeral: true + }); } const rData = { @@ -42,12 +48,12 @@ class Remindme extends Command { data.userData.reminds.push(rData); data.userData.markModified("reminds"); data.userData.save(); - this.client.databaseCache.usersReminds.set(message.author.id, data.userData); + this.client.databaseCache.usersReminds.set(interaction.user.id, data.userData); // Send success message - message.success("general/remindme:SAVED"); + interaction.reply({ + content: translate("general/remindme:SAVED") + }); } -} - -module.exports = Remindme; \ No newline at end of file +}; diff --git a/commands/General/report.js b/commands/General/report.js index 978a8ede65..7b323b2485 100644 --- a/commands/General/report.js +++ b/commands/General/report.js @@ -1,7 +1,7 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"); -class Report extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -9,7 +9,7 @@ class Report extends Command { dirname: __dirname, enabled: true, guildOnly: true, - aliases: [], + , memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -18,9 +18,9 @@ class Report extends Command { }); } - async run (message, args, data) { + async run (interaction, translate, data) { - const repChannel = message.guild.channels.cache.get(data.guild.plugins.reports); + const repChannel = message.guild.channels.cache.get(data.guildData.plugins.reports); if(!repChannel){ return message.error("general/report:MISSING_CHANNEL"); } @@ -30,7 +30,7 @@ class Report extends Command { return message.error("general/report:MISSING_USER"); } - if(member.id === message.author.id){ + if(member.id === interaction.user.id){ return message.error("general/report:INVALID_USER"); } @@ -40,13 +40,13 @@ class Report extends Command { } const embed = new Discord.MessageEmbed() - .setAuthor(message.translate("general/report:TITLE", { + .setAuthor(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:USER"), `\`${member.user.tag}\` (${member.user.toString()})`, true) + }), interaction.user.displayAvatarURL({ size: 512, dynamic: true, format: "png" })) + .addField(translate("common:AUTHOR"), interaction.user.tag, true) + .addField(translate("common:DATE"), message.printDate(new Date(Date.now())), true) + .addField(translate("common:REASON"), "**"+rep+"**", true) + .addField(translate("common:USER"), `\`${member.user.tag}\` (${member.user.toString()})`, true) .setColor(data.config.embed.color) .setFooter(data.config.embed.footer); @@ -63,6 +63,4 @@ class Report extends Command { }); } -} - -module.exports = Report; +}; diff --git a/commands/General/serverinfo.js b/commands/General/serverinfo.js index c85983ea6c..b7a1660186 100644 --- a/commands/General/serverinfo.js +++ b/commands/General/serverinfo.js @@ -1,7 +1,7 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"); -class Serverinfo extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -9,7 +9,7 @@ class Serverinfo extends Command { dirname: __dirname, enabled: true, guildOnly: true, - aliases: [ "si" ], + memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -17,7 +17,7 @@ class Serverinfo extends Command { }); } - async run (message, args, data) { + async run (interaction, translate, data) { let guild = message.guild; @@ -36,22 +36,22 @@ 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", { + .addField(this.client.customEmojis.title+translate("common:NAME"), guild.name, true) + .addField(this.client.customEmojis.calendar+translate("common:CREATION"), message.printDate(guild.createdAt), true) + .addField(this.client.customEmojis.users+translate("common:MEMBERS"), translate("general/serverinfo:MEMBERS", { count: guild.members.cache.filter(m => !m.user.bot).size - })+" | "+message.translate("general/serverinfo:BOTS", { + })+" | "+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.ownerID}>`, 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", { + .addField(this.client.customEmojis.afk+translate("general/serverinfo:AFK_CHANNEL"), guild.afkChannel || translate("general/serverinfo:NO_AFK_CHANNEL"), true) + .addField(this.client.customEmojis.id+translate("common:ID"), guild.id, true) + .addField(this.client.customEmojis.crown+translate("common:OWNER"), `<@${guild.ownerID}>`, true) + .addField(this.client.customEmojis.boost+translate("general/serverinfo:BOOSTS"), guild.premiumSubscriptionCount || 0, true) + .addField(this.client.customEmojis.channels+translate("common:CHANNELS"), translate("general/serverinfo:TEXT_CHANNELS", { count: guild.channels.cache.filter(c => c.type === "text").size - })+" | "+message.translate("general/serverinfo:VOICE_CHANNELS", { + })+" | "+translate("general/serverinfo:VOICE_CHANNELS", { count: guild.channels.cache.filter(c => c.type === "voice").size - })+" | "+message.translate("general/serverinfo:CAT_CHANNELS", { + })+" | "+translate("general/serverinfo:CAT_CHANNELS", { count: guild.channels.cache.filter(c => c.type === "category").size }), true) .setColor(data.config.embed.color) @@ -60,6 +60,4 @@ class Serverinfo extends Command { message.channel.send({ embeds: [embed] }); } -} - -module.exports = Serverinfo; \ No newline at end of file +}; diff --git a/commands/General/setafk.js b/commands/General/setafk.js index 4aa963c983..72135ab9d4 100644 --- a/commands/General/setafk.js +++ b/commands/General/setafk.js @@ -1,6 +1,6 @@ const Command = require("../../base/Command.js"); -class Setafk extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -8,7 +8,7 @@ class Setafk extends Command { dirname: __dirname, enabled: true, guildOnly: false, - aliases: [ "afk" ], + memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -16,11 +16,14 @@ class Setafk extends Command { }); } - async run (message, args, data) { + async run (interaction, translate, data) { const reason = args.join(" "); if(!reason){ - return message.error("general/setafk:MISSING_REASON"); + return interaction.reply({ + content: translate("general/setafk:MISSING_REASON"), + ephemeral: true + }); } // Send success message @@ -33,6 +36,4 @@ class Setafk extends Command { } -} - -module.exports = Setafk; \ No newline at end of file +}; diff --git a/commands/General/shorturl.js b/commands/General/shorturl.js index 870510762a..eee8e51428 100644 --- a/commands/General/shorturl.js +++ b/commands/General/shorturl.js @@ -2,7 +2,7 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"), fetch = require("node-fetch"); -class ShortURL extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -10,7 +10,7 @@ class ShortURL extends Command { dirname: __dirname, enabled: true, guildOnly: false, - aliases: [ "minimize" ], + memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -19,18 +19,24 @@ class ShortURL extends Command { }); } - async run (message, args, data) { + async run (interaction, translate, data) { const url = args[0]; if(!url){ - return message.error("general/shorturl:MISSING_URL"); + return interaction.reply({ + content: translate("general/shorturl:MISSING_URL"), + ephemeral: true + }); } const res = await fetch(`https://is.gd/create.php?format=simple&url=${encodeURI(url)}`); const body = await res.text(); if(body === "Error: Please enter a valid URL to shorten"){ - return message.error("general/shorturl:MISSING_URL"); + return interaction.reply({ + content: translate("general/shorturl:MISSING_URL"), + ephemeral: true + }); } const embed = new Discord.MessageEmbed() @@ -41,6 +47,4 @@ class ShortURL extends Command { } -} - -module.exports = ShortURL; \ No newline at end of file +}; diff --git a/commands/General/someone.js b/commands/General/someone.js index 8a6e4f2ad2..fcd380ac37 100644 --- a/commands/General/someone.js +++ b/commands/General/someone.js @@ -1,7 +1,7 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"); -class Someone extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -9,7 +9,7 @@ class Someone extends Command { dirname: __dirname, enabled: true, guildOnly: true, - aliases: [ "somebody", "something" ], + memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -18,20 +18,18 @@ class Someone extends Command { }); } - async run (message, args, data) { + async run (interaction, translate, data) { const member = message.guild.members.cache.random(1)[0]; const embed = new Discord.MessageEmbed() - .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' })) + .addField(translate("common:USERNAME"), member.user.username, true) + .addField(translate("common:DISCRIMINATOR"), member.user.discriminator, true) + .addField(translate("common:ID"), member.user.id, true) + .setThumbnail(member.user.displayAvatarURL({ size: 512, dynamic: true, format: "png" })) .setColor(data.config.embed.color); message.channel.send({ embeds: [embed] }); } -} - -module.exports = Someone; \ No newline at end of file +}; diff --git a/commands/General/staff.js b/commands/General/staff.js index 11c04a5362..3b8f10b452 100644 --- a/commands/General/staff.js +++ b/commands/General/staff.js @@ -1,7 +1,7 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"); -class Staff extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -9,7 +9,7 @@ class Staff extends Command { dirname: __dirname, enabled: true, guildOnly: true, - aliases: [ "stafflist", "staffliste" ], + memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -18,21 +18,19 @@ class Staff extends Command { }); } - async run (message, args, data) { + async run (interaction, translate, data) { await message.guild.members.fetch(); const administrators = message.guild.members.cache.filter((m) => m.permissions.has("ADMINISTRATOR") && !m.user.bot); const moderators = message.guild.members.cache.filter((m) => !administrators.has(m.id) && m.permissions.has("MANAGE_MESSAGES") && !m.user.bot); const embed = new Discord.MessageEmbed() - .setAuthor(message.translate("general/staff:TITLE", { + .setAuthor(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.tag}`).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.tag}`).join("\n") : message.translate("general/staff:NO_MODS"))) + .addField(translate("general/staff:ADMINS"), (administrators.size > 0 ? administrators.map((a) => `${this.client.customEmojis.status[a.presence.status]} | ${a.user.tag}`).join("\n") :translate("general/staff:NO_ADMINS"))) + .addField(translate("general/staff:MODS"), (moderators.size > 0 ? moderators.map((m) => `${this.client.customEmojis.status[m.presence.status]} | ${m.user.tag}`).join("\n") : translate("general/staff:NO_MODS"))) .setColor(data.config.embed.color) .setFooter(data.config.embed.footer); message.channel.send({ embeds: [embed] }); } -} - -module.exports = Staff; \ No newline at end of file +}; diff --git a/commands/General/stats.js b/commands/General/stats.js index 5056d12c1f..4169c4d2d2 100644 --- a/commands/General/stats.js +++ b/commands/General/stats.js @@ -1,7 +1,7 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"); -class Stats extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -9,7 +9,7 @@ class Stats extends Command { dirname: __dirname, enabled: true, guildOnly: false, - aliases: [ "statistics", "infobot", "botinfos", "bot-infos", "bot-info", "infos-bot", "info-bot" ], + memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -18,31 +18,31 @@ class Stats extends Command { }); } - async run (message, args, data) { + async run (interaction, translate, data) { const statsEmbed = new Discord.MessageEmbed() .setColor(data.config.embed.color) .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", { + .setAuthor(translate("common:STATS")) + .setDescription(translate("general/stats:MADE")) + .addField(this.client.customEmojis.stats+" "+translate("general/stats:COUNTS_TITLE"), 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", { + .addField(this.client.customEmojis.version+" "+translate("general/stats:VERSIONS_TITLE"), `\`Discord.js : v${Discord.version}\`\n\`Nodejs : v${process.versions.node}\``, true) + .addField(this.client.customEmojis.ram+" "+translate("general/stats:RAM_TITLE"), `\`${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2)}MB\``, true) + .addField(this.client.customEmojis.status.online+" "+translate("general/stats:ONLINE_TITLE"), 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", { + .addField(this.client.customEmojis.voice+" "+translate("general/stats:MUSIC_TITLE"), translate("general/stats:MUSIC_CONTENT", { count: this.client.voice.connections.size })) - .addField(message.translate("general/stats:CREDITS_TITLE"), message.translate("general/stats:CREDITS_CONTENT", { + .addField(translate("general/stats:CREDITS_TITLE"), translate("general/stats:CREDITS_CONTENT", { donators: [ "`Marty#0303` (**GOD**)", "`Reese's Cup#9637` (**SUPPORTER**)", "`\"\"#2020` (**SUPPORTER**)", "`✰DonjΝ₯บaΝ£nͫ✰#7777` (**SUPPORTER**)" ].join("\n"), translators: [ "`Lil Ethan. πŸ’€#1337` (:flag_fr:)", "`Mizuki#2477` (:flag_fr:)", "`shaynlink#9070` (:flag_fr:)", "`Androz#2091` (:flag_fr:)", "`kevinava#4941` (:flag_es:)", "`Gaming Mineblox#0256` (:flag_nl:)", "`!Slayx#0917` (:flag_it:)", "`Melocet#1645` (:flag_tr:)", "`Kobayakawa Takakage#7414` (:flag_za:)", "`sarkanyka444#7446` (:flag_hu:)" ].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+" "+translate("general/stats:LINKS_TITLE"), translate("misc:STATS_FOOTER", { donateLink: "https://patreon.com/Androz2091", dashboardLink: "https://dashboard.atlanta-bot.fr", inviteLink: await this.client.generateInvite({ @@ -56,6 +56,4 @@ class Stats extends Command { } -} - -module.exports = Stats; +}; diff --git a/commands/General/suggest.js b/commands/General/suggest.js index 5635c3ffd2..78bbb4332e 100644 --- a/commands/General/suggest.js +++ b/commands/General/suggest.js @@ -1,7 +1,7 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"); -class Suggest extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -9,7 +9,7 @@ class Suggest extends Command { dirname: __dirname, enabled: true, guildOnly: true, - aliases: [ "suggestion", "sugg" ], + memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -18,9 +18,9 @@ class Suggest extends Command { }); } - async run (message, args, data) { + async run (interaction, translate, data) { - const suggChannel = message.guild.channels.cache.get(data.guild.plugins.suggestions); + const suggChannel = message.guild.channels.cache.get(data.guildData.plugins.suggestions); if(!suggChannel){ return message.error("general/suggest:MISSING_CHANNEL"); } @@ -31,12 +31,12 @@ class Suggest extends Command { } const embed = new Discord.MessageEmbed() - .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+"**") + .setAuthor(translate("general/suggest:TITLE", { + user: interaction.user.username + }), interaction.user.displayAvatarURL({ size: 512, dynamic: true, format: "png" })) + .addField(translate("common:AUTHOR"), `\`${interaction.user.username}#${interaction.user.discriminator}\``, true) + .addField(translate("common:DATE"), message.printDate(new Date(Date.now())), true) + .addField(translate("common:CONTENT"), "**"+sugg+"**") .setColor(data.config.embed.color) .setFooter(data.config.embed.footer); @@ -53,6 +53,4 @@ class Suggest extends Command { }); } -} - -module.exports = Suggest; \ No newline at end of file +}; diff --git a/commands/General/translate.js b/commands/General/translate.js index 4b80bc63b8..aaed47a23e 100644 --- a/commands/General/translate.js +++ b/commands/General/translate.js @@ -1,10 +1,10 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"), - translate = require("@k3rn31p4nic/google-translate-api"); + translate = require("@iamtraction/google-translate"); const langs = ["afrikaans", "albanian", "amharic", "arabic", "armenian", "azerbaijani", "bangla", "basque", "belarusian", "bengali", "bosnian", "bulgarian", "burmese", "catalan", "cebuano", "chichewa", "corsican", "croatian", "czech", "danish", "dutch", "english", "esperanto", "estonian", "filipino", "finnish", "french", "frisian", "galician", "georgian", "german", "greek", "gujarati", "haitian creole", "hausa", "hawaiian", "hebrew", "hindi", "hmong", "hungarian", "icelandic", "igbo", "indonesian", "irish", "italian", "japanese", "javanese", "kannada", "kazakh", "khmer", "korean", "kurdish (kurmanji)", "kyrgyz", "lao", "latin", "latvian", "lithuanian", "luxembourgish", "macedonian", "malagasy", "malay", "malayalam", "maltese", "maori", "marathi", "mongolian", "myanmar (burmese)", "nepali", "norwegian", "nyanja", "pashto", "persian", "polish", "portugese", "punjabi", "romanian", "russian", "samoan", "scottish gaelic", "serbian", "sesotho", "shona", "sindhi", "sinhala", "slovak", "slovenian", "somali", "spanish", "sundanese", "swahili", "swedish", "tajik", "tamil", "telugu", "thai", "turkish", "ukrainian", "urdu", "uzbek", "vietnamese", "welsh", "xhosa", "yiddish", "yoruba", "zulu"]; -class Translate extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -12,7 +12,7 @@ class Translate extends Command { dirname: __dirname, enabled: true, guildOnly: false, - aliases: [ "traduction", "translation", "trad" ], + memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -21,14 +21,19 @@ class Translate extends Command { }); } - async run (message, args, data) { + async run (interaction, translate, data) { if(args[0] === "langs-list"){ const langsList = "```Css\n"+(langs.map((l, i) => `#${i+1} - ${l}`).join("\n"))+"```"; - message.author.send(langsList).then(() => { - message.success("general/translate:LIST_SENT"); + interaction.user.send(langsList).then(() => { + interaction.reply({ + content: translate("general/translate:LIST_SENT") + }); }).catch(() => { - message.error("misc:CANNOT_DM"); + interaction.reply({ + content: translate("misc:CANNOT_DM"), + ephemeral: true + }); }); return; } @@ -39,7 +44,7 @@ class Translate extends Command { if(!args[0]){ return pWait.error("general/translate:MISSING_LANGUAGE", { - prefix: data.guild.prefix + prefix: data.guildData.prefix }, { edit: true }); @@ -57,7 +62,7 @@ class Translate extends Command { if(!langs.includes(language)){ return pWait.error("general/translate:INVALID_LANGUAGE", { - prefix: data.guild.prefix, + prefix: data.guildData.prefix, search: language }, { edit: true @@ -77,6 +82,4 @@ class Translate extends Command { } -} - -module.exports = Translate; \ No newline at end of file +}; diff --git a/commands/General/userinfo.js b/commands/General/userinfo.js index 6cef716151..80eb9b0b06 100644 --- a/commands/General/userinfo.js +++ b/commands/General/userinfo.js @@ -2,7 +2,7 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"), fetch = require("node-fetch"); -class Userinfo extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -10,7 +10,7 @@ class Userinfo extends Command { dirname: __dirname, enabled: true, guildOnly: false, - aliases: [ "ui" ], + memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -19,7 +19,7 @@ class Userinfo extends Command { }); } - async run (message, args, data) { + async run (interaction, translate, data) { let displayPresence = true; @@ -27,7 +27,7 @@ class Userinfo extends Command { var user; if(!args[0]){ - user = message.author; + user = interaction.user; } if(message.mentions.users.first()){ user = message.mentions.users.first(); @@ -50,30 +50,30 @@ class Userinfo extends Command { } 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: "+translate("common:USERNAME"), user.username, true) + .addField(this.client.customEmojis.discriminator+" "+translate("common:DISCRIMINATOR"), user.discriminator, true) + .addField(this.client.customEmojis.bot+" "+translate("common:ROBOT"), (user.bot ? translate("common:YES") : translate("common:NO")), true) + .addField(this.client.customEmojis.calendar+" "+translate("common:CREATION"), message.printDate(user.createdAt), true) + .addField(this.client.customEmojis.avatar+" "+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) - .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+" "+translate("common:GAME"), (user.presence.activity ? user.presence.activity.name : translate("general/userinfo:NO_GAME")), true) + .addField(this.client.customEmojis.status.online+" "+translate("common:STATUS"), 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) - .addField(this.client.customEmojis.calendar2+" "+message.translate("common:JOIN"), message.printDate(member.joinedAt),true) - .addField(this.client.customEmojis.color+" "+message.translate("common:COLOR"), member.displayHexColor, true) - .addField(this.client.customEmojis.pencil+" "+message.translate("common:NICKNAME"), (member.nickname ? member.nickname : message.translate("general/userinfo:NO_NICKNAME")), true) - .addField(this.client.customEmojis.roles+" "+message.translate("common:ROLES"), ( + embed.addField(this.client.customEmojis.up+" "+translate("common:ROLE"), (member.roles.highest ? member.roles.highest : translate("general/userinfo:NO_ROLE")), true) + .addField(this.client.customEmojis.calendar2+" "+translate("common:JOIN"), message.printDate(member.joinedAt),true) + .addField(this.client.customEmojis.color+" "+translate("common:COLOR"), member.displayHexColor, true) + .addField(this.client.customEmojis.pencil+" "+translate("common:NICKNAME"), (member.nickname ? member.nickname : translate("general/userinfo:NO_NICKNAME")), true) + .addField(this.client.customEmojis.roles+" "+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(", ") + ? member.roles.cache.map((r) => r).slice(0, 9).join(", ")+" "+translate("general/userinfo:MORE_ROLES", { count: member.roles.cache.size - 10 }) + : (member.roles.cache.size < 1) ? translate("general/userinfo:NO_ROLE") : member.roles.cache.map((r) => r).join(", ") )); } @@ -83,15 +83,15 @@ class Userinfo extends Command { }); 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+" "+translate("common:DESCRIPTION"), data.shortdesc, true) + .addField(this.client.customEmojis.stats+" "+translate("common:STATS"), 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})` : ""}` + .addField(this.client.customEmojis.link+" "+translate("common:LINKS"), + `${data.support ? `[${translate("common:SUPPORT")}](${data.support}) | ` : ""}${data.invite ? `[${translate("common:INVITE")}](${data.invite}) | ` : ""}${data.github ? `[GitHub](${data.github}) | ` : ""}${data.website ? `[${translate("common:WEBSITE")}](${data.website})` : ""}` , true); } } @@ -99,6 +99,4 @@ class Userinfo extends Command { message.channel.send({ embeds: [embed] }); } -} - -module.exports = Userinfo; +}; diff --git a/commands/Images/approved.js b/commands/Images/approved.js index fff35e8a71..4126bc098a 100644 --- a/commands/Images/approved.js +++ b/commands/Images/approved.js @@ -1,14 +1,14 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"); -class Approved extends Command { +module.exports = class extends Command { constructor (client) { super(client, { name: "approved", dirname: __dirname, enabled: true, guildOnly: false, - aliases: [], + , memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES" ], nsfw: false, @@ -17,9 +17,9 @@ class Approved extends Command { }); } - async run (message, args) { + async run (interaction, translate) { - const user = await this.client.resolveUser(args[0]) || message.author; + const user = await this.client.resolveUser(args[0]) || interaction.user; const m = await message.sendT("misc:PLEASE_WAIT", null, { prefixEmoji: "loading" }); @@ -30,6 +30,4 @@ class Approved extends Command { } -} - -module.exports = Approved; +}; diff --git a/commands/Images/avatar.js b/commands/Images/avatar.js index 72055be290..2b3da58dc8 100644 --- a/commands/Images/avatar.js +++ b/commands/Images/avatar.js @@ -1,14 +1,14 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"); -class Avatar extends Command { +module.exports = class extends Command { constructor (client) { super(client, { name: "avatar", dirname: __dirname, enabled: true, guildOnly: false, - aliases: [], + , memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES" ], nsfw: false, @@ -17,17 +17,15 @@ class Avatar extends Command { }); } - async run (message, args) { + async run (interaction, translate) { let user = await this.client.resolveUser(args[0]); - if(!user) user = message.author; - const avatarURL = user.displayAvatarURL({ size: 512, dynamic: true, format: 'png' }); + if(!user) user = interaction.user; + 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); } -} - -module.exports = Avatar; +}; diff --git a/commands/Images/batslap.js b/commands/Images/batslap.js index 17571324fa..e577dd5779 100644 --- a/commands/Images/batslap.js +++ b/commands/Images/batslap.js @@ -1,14 +1,14 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"); -class BatSlap extends Command { +module.exports = class extends Command { constructor (client) { super(client, { name: "batslap", dirname: __dirname, enabled: true, guildOnly: false, - aliases: [], + , memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES" ], nsfw: false, @@ -17,11 +17,11 @@ class BatSlap extends Command { }); } - async run (message, args) { + async run (interaction, translate) { const users = [ - await this.client.resolveUser(args[0]) || message.author, - await this.client.resolveUser(args[1]) || message.author + await this.client.resolveUser(args[0]) || interaction.user, + await this.client.resolveUser(args[1]) || interaction.user ]; const m = await message.sendT("misc:PLEASE_WAIT", null, { prefixEmoji: "loading" @@ -33,6 +33,4 @@ class BatSlap extends Command { } -} - -module.exports = BatSlap; +}; diff --git a/commands/Images/beautiful.js b/commands/Images/beautiful.js index 2cfd8f79bf..5e1023687c 100644 --- a/commands/Images/beautiful.js +++ b/commands/Images/beautiful.js @@ -1,14 +1,14 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"); -class Beautiful extends Command { +module.exports = class extends Command { constructor (client) { super(client, { name: "beautiful", dirname: __dirname, enabled: true, guildOnly: false, - aliases: [], + , memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES" ], nsfw: false, @@ -17,9 +17,9 @@ class Beautiful extends Command { }); } - async run (message, args) { + async run (interaction, translate) { - const user = await this.client.resolveUser(args[0]) || message.author; + const user = await this.client.resolveUser(args[0]) || interaction.user; const m = await message.sendT("misc:PLEASE_WAIT", null, { prefixEmoji: "loading" }); @@ -30,6 +30,4 @@ class Beautiful extends Command { } -} - -module.exports = Beautiful; +}; diff --git a/commands/Images/bed.js b/commands/Images/bed.js index 5c4d5eb2f0..5d26c57f3c 100644 --- a/commands/Images/bed.js +++ b/commands/Images/bed.js @@ -2,14 +2,14 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"), canvacord = require("canvacord"); -class Bed extends Command { +module.exports = class extends Command { constructor (client) { super(client, { name: "bed", dirname: __dirname, enabled: true, guildOnly: false, - aliases: [], + , memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES" ], nsfw: false, @@ -18,11 +18,11 @@ class Bed extends Command { }); } - async run (message, args) { + async run (interaction, translate) { const users = [ - await this.client.resolveUser(args[0]) || message.author, - await this.client.resolveUser(args[1]) || message.author + await this.client.resolveUser(args[0]) || interaction.user, + await this.client.resolveUser(args[1]) || interaction.user ]; const m = await message.sendT("misc:PLEASE_WAIT", null, { @@ -42,6 +42,4 @@ class Bed extends Command { } -} - -module.exports = Bed; \ No newline at end of file +}; diff --git a/commands/Images/brazzers.js b/commands/Images/brazzers.js index d83f0d9fa9..91496cb51e 100644 --- a/commands/Images/brazzers.js +++ b/commands/Images/brazzers.js @@ -1,14 +1,14 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"); -class Brazzers extends Command { +module.exports = class extends Command { constructor (client) { super(client, { name: "brazzers", dirname: __dirname, enabled: true, guildOnly: false, - aliases: [], + , memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES" ], nsfw: false, @@ -17,9 +17,9 @@ class Brazzers extends Command { }); } - async run (message, args) { + async run (interaction, translate) { - const user = await this.client.resolveUser(args[0]) || message.author; + const user = await this.client.resolveUser(args[0]) || interaction.user; const m = await message.sendT("misc:PLEASE_WAIT", null, { prefixEmoji: "loading" }); @@ -30,6 +30,4 @@ class Brazzers extends Command { } -} - -module.exports = Brazzers; +}; diff --git a/commands/Images/burn.js b/commands/Images/burn.js index ddd6da6c20..143df82e9d 100644 --- a/commands/Images/burn.js +++ b/commands/Images/burn.js @@ -1,14 +1,14 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"); -class Burn extends Command { +module.exports = class extends Command { constructor (client) { super(client, { name: "burn", dirname: __dirname, enabled: true, guildOnly: false, - aliases: [], + , memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES" ], nsfw: false, @@ -17,9 +17,9 @@ class Burn extends Command { }); } - async run (message, args) { + async run (interaction, translate) { - const user = await this.client.resolveUser(args[0]) || message.author; + const user = await this.client.resolveUser(args[0]) || interaction.user; const m = await message.sendT("misc:PLEASE_WAIT", null, { prefixEmoji: "loading" }); @@ -30,6 +30,4 @@ class Burn extends Command { } -} - -module.exports = Burn; +}; diff --git a/commands/Images/captcha.js b/commands/Images/captcha.js index 9fc1af6c54..78de3b9734 100644 --- a/commands/Images/captcha.js +++ b/commands/Images/captcha.js @@ -2,14 +2,14 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"), fetch = require("node-fetch"); -class Captcha extends Command { +module.exports = class extends Command { constructor (client) { super(client, { name: "captcha", dirname: __dirname, enabled: true, guildOnly: false, - aliases: [], + , memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES" ], nsfw: false, @@ -18,9 +18,9 @@ class Captcha extends Command { }); } - async run (message, args) { + async run (interaction, translate) { - const user = await this.client.resolveUser(args[0]) || message.author; + const user = await this.client.resolveUser(args[0]) || interaction.user; const m = await message.sendT("misc:PLEASE_WAIT", null, { prefixEmoji: "loading" }); @@ -39,6 +39,4 @@ class Captcha extends Command { } -} - -module.exports = Captcha; \ No newline at end of file +}; diff --git a/commands/Images/challenger.js b/commands/Images/challenger.js index 83c540dc05..c584760397 100644 --- a/commands/Images/challenger.js +++ b/commands/Images/challenger.js @@ -1,14 +1,14 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"); -class Challenger extends Command { +module.exports = class extends Command { constructor (client) { super(client, { name: "challenger", dirname: __dirname, enabled: true, guildOnly: false, - aliases: [], + , memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES" ], nsfw: false, @@ -17,9 +17,9 @@ class Challenger extends Command { }); } - async run (message, args) { + async run (interaction, translate) { - const user = await this.client.resolveUser(args[0]) || message.author; + const user = await this.client.resolveUser(args[0]) || interaction.user; const m = await message.sendT("misc:PLEASE_WAIT", null, { prefixEmoji: "loading" }); @@ -30,6 +30,4 @@ class Challenger extends Command { } -} - -module.exports = Challenger; +}; diff --git a/commands/Images/clyde.js b/commands/Images/clyde.js index bee4fc7c57..104edfa8e5 100644 --- a/commands/Images/clyde.js +++ b/commands/Images/clyde.js @@ -2,14 +2,14 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"), fetch = require("node-fetch"); -class Clyde extends Command { +module.exports = class extends Command { constructor (client) { super(client, { name: "clyde", dirname: __dirname, enabled: true, guildOnly: false, - aliases: [], + , memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES" ], nsfw: false, @@ -18,12 +18,15 @@ class Clyde extends Command { }); } - async run (message, args) { + async run (interaction, translate) { const text = args.join(" "); if(!text){ - return message.error("images/clyde:MISSING_TEXT"); + return interaction.reply({ + content: translate("images/clyde:MISSING_TEXT"), + ephemeral: true + }); } const m = await message.sendT("misc:PLEASE_WAIT", null, { @@ -44,6 +47,4 @@ class Clyde extends Command { } -} - -module.exports = Clyde; \ No newline at end of file +}; diff --git a/commands/Images/dictator.js b/commands/Images/dictator.js index 4678d1be95..646cfe8b9a 100644 --- a/commands/Images/dictator.js +++ b/commands/Images/dictator.js @@ -1,14 +1,14 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"); -class Dictator extends Command { +module.exports = class extends Command { constructor (client) { super(client, { name: "dictator", dirname: __dirname, enabled: true, guildOnly: false, - aliases: [], + , memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES" ], nsfw: false, @@ -17,9 +17,9 @@ class Dictator extends Command { }); } - async run (message, args) { + async run (interaction, translate) { - const user = await this.client.resolveUser(args[0]) || message.author; + const user = await this.client.resolveUser(args[0]) || interaction.user; const m = await message.sendT("misc:PLEASE_WAIT", null, { prefixEmoji: "loading" }); @@ -30,6 +30,4 @@ class Dictator extends Command { } -} - -module.exports = Dictator; +}; diff --git a/commands/Images/facepalm.js b/commands/Images/facepalm.js index 50bb284886..aa0a4260e5 100644 --- a/commands/Images/facepalm.js +++ b/commands/Images/facepalm.js @@ -2,14 +2,14 @@ const Command = require("../../base/Command.js"), Canvas = require("canvas"), Discord = require("discord.js"); -class Facepalm extends Command { +module.exports = class extends Command { constructor (client) { super(client, { name: "facepalm", dirname: __dirname, enabled: true, guildOnly: false, - aliases: [ "palm" ], + memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES" ], nsfw: false, @@ -18,9 +18,9 @@ class Facepalm extends Command { }); } - async run (message, args) { + async run (interaction, translate) { - const user = await this.client.resolveUser(args[0]) || message.author, + const user = await this.client.resolveUser(args[0]) || interaction.user, m = await message.sendT("misc:PLEASE_WAIT", null, { prefixEmoji: "loading" }); @@ -47,6 +47,4 @@ class Facepalm extends Command { } -} - -module.exports = Facepalm; +}; diff --git a/commands/Images/fire.js b/commands/Images/fire.js index 77277e6d03..9e5e18bd61 100644 --- a/commands/Images/fire.js +++ b/commands/Images/fire.js @@ -1,14 +1,14 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"); -class Fire extends Command { +module.exports = class extends Command { constructor (client) { super(client, { name: "fire", dirname: __dirname, enabled: true, guildOnly: false, - aliases: [], + , memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES" ], nsfw: false, @@ -17,9 +17,9 @@ class Fire extends Command { }); } - async run (message, args) { + async run (interaction, translate) { - const user = await this.client.resolveUser(args[0]) || message.author; + const user = await this.client.resolveUser(args[0]) || interaction.user; const m = await message.sendT("misc:PLEASE_WAIT", null, { prefixEmoji: "loading" }); @@ -30,6 +30,4 @@ class Fire extends Command { } -} - -module.exports = Fire; \ No newline at end of file +}; diff --git a/commands/Images/jail.js b/commands/Images/jail.js index 9af67a4e64..98367f5208 100644 --- a/commands/Images/jail.js +++ b/commands/Images/jail.js @@ -1,14 +1,14 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"); -class Jail extends Command { +module.exports = class extends Command { constructor (client) { super(client, { name: "jail", dirname: __dirname, enabled: true, guildOnly: false, - aliases: [], + , memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES" ], nsfw: false, @@ -17,9 +17,9 @@ class Jail extends Command { }); } - async run (message, args) { + async run (interaction, translate) { - const user = await this.client.resolveUser(args[0]) || message.author; + const user = await this.client.resolveUser(args[0]) || interaction.user; const m = await message.sendT("misc:PLEASE_WAIT", null, { prefixEmoji: "loading" }); @@ -30,6 +30,4 @@ class Jail extends Command { } -} - -module.exports = Jail; \ No newline at end of file +}; diff --git a/commands/Images/love.js b/commands/Images/love.js index f3a9068083..8a5160dc1a 100644 --- a/commands/Images/love.js +++ b/commands/Images/love.js @@ -2,14 +2,14 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"), fetch = require("node-fetch"); -class Love extends Command { +module.exports = class extends Command { constructor (client) { super(client, { name: "love", dirname: __dirname, enabled: true, guildOnly: false, - aliases: [], + , memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES" ], nsfw: false, @@ -18,11 +18,11 @@ class Love extends Command { }); } - async run (message, args) { + async run (interaction, translate) { const users = [ - await this.client.resolveUser(args[0]) || message.author, - await this.client.resolveUser(args[1]) || message.author + await this.client.resolveUser(args[0]) || interaction.user, + await this.client.resolveUser(args[1]) || interaction.user ]; const m = await message.sendT("misc:PLEASE_WAIT", null, { @@ -43,6 +43,4 @@ class Love extends Command { } -} - -module.exports = Love; \ No newline at end of file +}; diff --git a/commands/Images/mission.js b/commands/Images/mission.js index 7ccdd7a9d7..f08f216a9b 100644 --- a/commands/Images/mission.js +++ b/commands/Images/mission.js @@ -1,14 +1,14 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"); -class Mission extends Command { +module.exports = class extends Command { constructor (client) { super(client, { name: "mission", dirname: __dirname, enabled: true, guildOnly: false, - aliases: [], + , memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES" ], nsfw: false, @@ -17,9 +17,9 @@ class Mission extends Command { }); } - async run (message, args) { + async run (interaction, translate) { - const user = await this.client.resolveUser(args[0]) || message.author; + const user = await this.client.resolveUser(args[0]) || interaction.user; const m = await message.sendT("images/mission:PLEASE_WAIT", null, { prefixEmoji: "loading" }); @@ -30,6 +30,4 @@ class Mission extends Command { } -} - -module.exports = Mission; \ No newline at end of file +}; diff --git a/commands/Images/phcomment.js b/commands/Images/phcomment.js index 6c8f8f7362..a9a05a799b 100644 --- a/commands/Images/phcomment.js +++ b/commands/Images/phcomment.js @@ -2,14 +2,14 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"), canvacord = require("canvacord"); -class Phcomment extends Command { +module.exports = class extends Command { constructor (client) { super(client, { name: "phcomment", dirname: __dirname, enabled: true, guildOnly: false, - aliases: [], + , memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES" ], nsfw: false, @@ -18,7 +18,7 @@ class Phcomment extends Command { }); } - async run (message, args) { + async run (interaction, translate) { let user = await this.client.resolveUser(args[0]); let text = args.join(" "); @@ -26,11 +26,14 @@ class Phcomment extends Command { if(user){ text = args.slice(1).join(" "); } else { - user = message.author; + user = interaction.user; } if(!text){ - return message.error("images/phcomment:MISSING_TEXT"); + return interaction.reply({ + content: translate("images/phcomment:MISSING_TEXT"), + ephemeral: true + }); } const m = await message.sendT("misc:PLEASE_WAIT", null, { @@ -54,6 +57,4 @@ class Phcomment extends Command { } -} - -module.exports = Phcomment; \ No newline at end of file +}; diff --git a/commands/Images/qrcode.js b/commands/Images/qrcode.js index 39a13ca6d2..ddd832abff 100644 --- a/commands/Images/qrcode.js +++ b/commands/Images/qrcode.js @@ -1,7 +1,7 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"); -class Qrcode extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -9,7 +9,7 @@ class Qrcode extends Command { dirname: __dirname, enabled: true, guildOnly: false, - aliases: [ "qr" ], + memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -18,11 +18,14 @@ class Qrcode extends Command { }); } - async run (message, args, data) { + async run (interaction, translate, data) { const text = args.join(" "); if(!text){ - return message.error("images/qrcode:MISSING_TEXT"); + return interaction.reply({ + content: translate("images/qrcode:MISSING_TEXT"), + ephemeral: true + }); } const pleaseWait = await message.sendT("misc:PLEASE_WAIT", null, { @@ -33,10 +36,8 @@ class Qrcode extends Command { .setImage(`https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=${text.replace(new RegExp(" ", "g"), "%20")}`) .setColor(data.config.embed.color); - pleaseWait.edit({ embeds: [embed], content: message.translate("images/qrcode:SUCCESS") }); + pleaseWait.edit({ embeds: [embed], content: translate("images/qrcode:SUCCESS") }); } -} - -module.exports = Qrcode; \ No newline at end of file +}; diff --git a/commands/Images/rip.js b/commands/Images/rip.js index 129c8dacfe..d52fd0499a 100644 --- a/commands/Images/rip.js +++ b/commands/Images/rip.js @@ -1,14 +1,14 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"); -class Rip extends Command { +module.exports = class extends Command { constructor (client) { super(client, { name: "rip", dirname: __dirname, enabled: true, guildOnly: false, - aliases: [], + , memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES" ], nsfw: false, @@ -17,9 +17,9 @@ class Rip extends Command { }); } - async run (message, args) { + async run (interaction, translate) { - const user = await this.client.resolveUser(args[0]) || message.author; + const user = await this.client.resolveUser(args[0]) || interaction.user; const m = await message.sendT("misc:PLEASE_WAIT", null, { prefixEmoji: "loading" }); @@ -30,6 +30,4 @@ class Rip extends Command { } -} - -module.exports = Rip; \ No newline at end of file +}; diff --git a/commands/Images/scary.js b/commands/Images/scary.js index adb7488c24..ebd57c2680 100644 --- a/commands/Images/scary.js +++ b/commands/Images/scary.js @@ -1,14 +1,14 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"); -class Scary extends Command { +module.exports = class extends Command { constructor (client) { super(client, { name: "scary", dirname: __dirname, enabled: true, guildOnly: false, - aliases: [], + , memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES" ], nsfw: false, @@ -17,9 +17,9 @@ class Scary extends Command { }); } - async run (message, args) { + async run (interaction, translate) { - const user = await this.client.resolveUser(args[0]) || message.author; + const user = await this.client.resolveUser(args[0]) || interaction.user; const m = await message.sendT("misc:PLEASE_WAIT", null, { prefixEmoji: "loading" }); @@ -30,6 +30,4 @@ class Scary extends Command { } -} - -module.exports = Scary; \ No newline at end of file +}; diff --git a/commands/Images/tobecontinued.js b/commands/Images/tobecontinued.js index 72b1b1bfd8..092a208626 100644 --- a/commands/Images/tobecontinued.js +++ b/commands/Images/tobecontinued.js @@ -1,14 +1,14 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"); -class Tobecontinued extends Command { +module.exports = class extends Command { constructor (client) { super(client, { name: "tobecontinued", dirname: __dirname, enabled: true, guildOnly: false, - aliases: [], + , memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES" ], nsfw: false, @@ -17,9 +17,9 @@ class Tobecontinued extends Command { }); } - async run (message, args) { + async run (interaction, translate) { - const user = await this.client.resolveUser(args[0]) || message.author; + const user = await this.client.resolveUser(args[0]) || interaction.user; const m = await message.sendT("misc:PLEASE_WAIT", null, { prefixEmoji: "loading" }); @@ -30,6 +30,4 @@ class Tobecontinued extends Command { } -} - -module.exports = Tobecontinued; \ No newline at end of file +}; diff --git a/commands/Images/trash.js b/commands/Images/trash.js index f8002e96f7..9c58753c3c 100644 --- a/commands/Images/trash.js +++ b/commands/Images/trash.js @@ -2,14 +2,14 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"), canvacord = require("canvacord"); -class Trash extends Command { +module.exports = class extends Command { constructor (client) { super(client, { name: "trash", dirname: __dirname, enabled: true, guildOnly: false, - aliases: [], + , memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES" ], nsfw: false, @@ -18,9 +18,9 @@ class Trash extends Command { }); } - async run (message, args) { + async run (interaction, translate) { - const user = await this.client.resolveUser(args[0]) || message.author; + const user = await this.client.resolveUser(args[0]) || interaction.user; const m = await message.sendT("misc:PLEASE_WAIT", null, { prefixEmoji: "loading" }); @@ -31,6 +31,4 @@ class Trash extends Command { } -} - -module.exports = Trash; \ No newline at end of file +}; diff --git a/commands/Images/triggered.js b/commands/Images/triggered.js index efeab7dd63..ba791f4ab7 100644 --- a/commands/Images/triggered.js +++ b/commands/Images/triggered.js @@ -1,14 +1,14 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"); -class Triggered extends Command { +module.exports = class extends Command { constructor (client) { super(client, { name: "triggered", dirname: __dirname, enabled: true, guildOnly: false, - aliases: [], + , memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES" ], nsfw: false, @@ -17,9 +17,9 @@ class Triggered extends Command { }); } - async run (message, args) { + async run (interaction, translate) { - const user = await this.client.resolveUser(args[0]) || message.author; + const user = await this.client.resolveUser(args[0]) || interaction.user; const m = await message.sendT("misc:PLEASE_WAIT", null, { prefixEmoji: "loading" }); @@ -30,6 +30,4 @@ class Triggered extends Command { } -} - -module.exports = Triggered; \ No newline at end of file +}; diff --git a/commands/Images/tweet.js b/commands/Images/tweet.js index 953b266886..ff7396a7ef 100644 --- a/commands/Images/tweet.js +++ b/commands/Images/tweet.js @@ -1,7 +1,7 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"); -class Tweet extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -9,7 +9,7 @@ class Tweet extends Command { dirname: __dirname, enabled: true, guildOnly: false, - aliases: [ "twitter" ], + memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -18,17 +18,23 @@ class Tweet extends Command { }); } - async run (message, args) { + async run (interaction, translate) { - const user = message.mentions.users.first() || message.author; + const user = message.mentions.users.first() || interaction.user; const text = args.slice(1).join(" "); if(!user){ - return message.error("images/tweet:MISSING_USERNAME"); + return interaction.reply({ + content: translate("images/tweet:MISSING_USERNAME"), + ephemeral: true + }); } if(!text){ - return message.error("images/tweet:MISSING_TEXT"); + return interaction.reply({ + content: translate("images/tweet:MISSING_TEXT"), + ephemeral: true + }); } const m = await message.sendT("misc:PLEASE_WAIT", null, { @@ -51,6 +57,4 @@ class Tweet extends Command { } -} - -module.exports = Tweet; \ No newline at end of file +}; diff --git a/commands/Images/wanted.js b/commands/Images/wanted.js index c5d02a918c..229c4aa157 100644 --- a/commands/Images/wanted.js +++ b/commands/Images/wanted.js @@ -1,14 +1,14 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"); -class Wanted extends Command { +module.exports = class extends Command { constructor (client) { super(client, { name: "wanted", dirname: __dirname, enabled: true, guildOnly: false, - aliases: [], + , memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES" ], nsfw: false, @@ -17,9 +17,9 @@ class Wanted extends Command { }); } - async run (message, args) { + async run (interaction, translate) { - const user = await this.client.resolveUser(args[0]) || message.author; + const user = await this.client.resolveUser(args[0]) || interaction.user; const m = await message.sendT("misc:PLEASE_WAIT", null, { prefixEmoji: "loading" }); @@ -30,6 +30,4 @@ class Wanted extends Command { } -} - -module.exports = Wanted; \ No newline at end of file +}; diff --git a/commands/Images/wasted.js b/commands/Images/wasted.js index 985f8e1037..7f62047ee6 100644 --- a/commands/Images/wasted.js +++ b/commands/Images/wasted.js @@ -1,14 +1,14 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"); -class Wasted extends Command { +module.exports = class extends Command { constructor (client) { super(client, { name: "wasted", dirname: __dirname, enabled: true, guildOnly: false, - aliases: [], + , memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES" ], nsfw: false, @@ -17,9 +17,9 @@ class Wasted extends Command { }); } - async run (message, args) { + async run (interaction, translate) { - const user = await this.client.resolveUser(args[0]) || message.author; + const user = await this.client.resolveUser(args[0]) || interaction.user; const m = await message.sendT("misc:PLEASE_WAIT", null, { prefixEmoji: "loading" }); @@ -30,6 +30,4 @@ class Wasted extends Command { } -} - -module.exports = Wasted; \ No newline at end of file +}; diff --git a/commands/Images/youtube-comment.js b/commands/Images/youtube-comment.js index 2b36a31c75..32c69a03fd 100644 --- a/commands/Images/youtube-comment.js +++ b/commands/Images/youtube-comment.js @@ -2,14 +2,14 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"), canvacord = require("canvacord"); -class YouTubeComment extends Command { +module.exports = class extends Command { constructor (client) { super(client, { name: "youtube-comment", dirname: __dirname, enabled: true, guildOnly: false, - aliases: [], + , memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "ATTACH_FILES" ], nsfw: false, @@ -18,7 +18,7 @@ class YouTubeComment extends Command { }); } - async run (message, args) { + async run (interaction, translate) { let user = await this.client.resolveUser(args[0]); let text = args.join(" "); @@ -26,11 +26,14 @@ class YouTubeComment extends Command { if(user){ text = args.slice(1).join(" "); } else { - user = message.author; + user = interaction.user; } if(!text){ - return message.error("images/phcomment:MISSING_TEXT"); // same text as phcomment + return interaction.reply({ + content: translate("images/phcomment:MISSING_TEXT"), + ephemeral: true + }); // same text as phcomment } const m = await message.sendT("misc:PLEASE_WAIT", null, { @@ -47,6 +50,4 @@ class YouTubeComment extends Command { } -} - -module.exports = YouTubeComment; \ No newline at end of file +}; diff --git a/commands/Moderation/announcement.js b/commands/Moderation/announcement.js deleted file mode 100644 index ffc8ee2969..0000000000 --- a/commands/Moderation/announcement.js +++ /dev/null @@ -1,101 +0,0 @@ -const Command = require("../../base/Command.js"), - Discord = require("discord.js"); - -class Announcement extends Command { - - constructor (client) { - super(client, { - name: "announcement", - dirname: __dirname, - enabled: true, - guildOnly: true, - aliases: [], - memberPermissions: [ "MENTION_EVERYONE" ], - botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], - nsfw: false, - ownerOnly: false, - cooldown: 3000 - }); - } - - async run (message, args, data) { - - const text = args.join(" "); - if(!text){ - return message.error("moderation/announcement:MISSING_TEXT"); - } - if(text.length > 1030){ - return message.error("moderation/announcement:TOO_LONG"); - } - - message.delete().catch(() => {}); - - let mention = ""; - - const msg = await message.sendT("moderation/announcement:MENTION_PROMPT"); - - const collector = new Discord.MessageCollector(message.channel, (m) => m.author.id === message.author.id, { time: 240000 }); - - collector.on("collect", async (tmsg) => { - - if(tmsg.content.toLowerCase() === message.translate("common:NO").toLowerCase()){ - tmsg.delete(); - msg.delete(); - collector.stop(true); - } - - if(tmsg.content.toLowerCase() === message.translate("common:YES").toLowerCase()){ - tmsg.delete(); - msg.delete(); - const tmsg1 = await message.sendT("moderation/announcement:MENTION_TYPE_PROMPT"); - const c = new Discord.MessageCollector(message.channel, (m) => m.author.id === message.author.id, { time: 60000 }); - c.on("collect", (m) => { - if(m.content.toLowerCase() === "here"){ - mention = "@here"; - tmsg1.delete(); - m.delete(); - collector.stop(true); - c.stop(true); - } else if(m.content.toLowerCase() === "every"){ - mention = "@everyone"; - tmsg1.delete(); - m.delete(); - collector.stop(true); - c.stop(true); - } - }); - c.on("end", (collected, reason) => { - if(reason === "time"){ - return message.error("misc:TIMES_UP"); - } - }); - } - }); - - collector.on("end", (collected, reason) => { - - if(reason === "time"){ - return message.error("misc:TIMES_UP"); - } - - const embed = new Discord.MessageEmbed() - .setAuthor(message.translate("moderation/announcement:TITLE")) - .setColor(data.config.embed.color) - .setFooter(message.author.tag) - .setTimestamp() - .setDescription(text); - - message.channel.send({ - content: mention, - embeds: [embed], - allowedMentions: { - parse: ["users", "everyone", "roles"] - } - }); - }); - - } - -} - -module.exports = Announcement; \ No newline at end of file diff --git a/commands/Moderation/ban.js b/commands/Moderation/ban.js index 9bd12b5495..15cc57da82 100644 --- a/commands/Moderation/ban.js +++ b/commands/Moderation/ban.js @@ -1,86 +1,114 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"); -class Ban extends Command { +module.exports = class extends Command { constructor (client) { super(client, { name: "ban", - dirname: __dirname, + + options: [ + { + name: "user", + type: "USER", + required: true + }, + { + name: "reason", + type: "STRING" + } + ], + enabled: true, guildOnly: true, - aliases: [], memberPermissions: [ "BAN_MEMBERS" ], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "BAN_MEMBERS" ], nsfw: false, ownerOnly: false, - cooldown: 3000 + + dirname: __dirname }); } - async run (message, args, data) { + async run (interaction, translate, data) { - const user = await this.client.resolveUser(args[0]); - if(!user){ - return message.error("moderation/ban:MISSING_MEMBER"); + const user = interaction.options.getUser("user"); + const member = interaction.guild.members.cache.get(user.id) ?? await interaction.guild.members.fetch(user.id).catch(() => {}); + + if (!member) { + return void interaction.reply({ + content: translate("misc:USER_NOT_SERVER"), + ephemeral: true + }); } - - const memberData = message.guild.members.cache.get(user.id) ? await this.client.findOrCreateMember({ id: user.id, guildID: message.guild.id }) : null; - if(user.id === message.author.id){ - return message.error("moderation/ban:YOURSELF"); + const memberData = interaction.guild.members.cache.get(user.id) && await this.client.findOrCreateMember({ id: user.id, guildID: interaction.guild.id }); + + if(user.id === interaction.user.id){ + return interaction.reply({ + content: translate("moderation/ban:YOURSELF"), + ephemeral: true + }); } // If the user is already banned - const banned = await message.guild.fetchBans(); + const banned = await interaction.guild.bans.fetch(); if(banned.some((m) => m.user.id === user.id)){ - return message.error("moderation/ban:ALREADY_BANNED", { - username: user.tag + return interaction.reply({ + content: translate("moderation/ban:ALREADY_BANNED", { + username: user.tag + }) }); } // Gets the ban reason - let reason = args.slice(1).join(" "); - if(!reason){ - reason = message.translate("misc:NO_REASON_PROVIDED"); - } + const reason = interaction.options.getString("reason") ?? translate("misc:NO_REASON_PROVIDED"); - const member = await message.guild.members.fetch(user.id).catch(() => {}); if(member){ const memberPosition = member.roles.highest.position; - const moderationPosition = message.member.roles.highest.position; - if(message.member.ownerID !== message.author.id && !(moderationPosition > memberPosition)){ - return message.error("moderation/ban:SUPERIOR"); + const moderationPosition = interaction.member.roles.highest.position; + if(interaction.guild.ownerID !== interaction.user.id && !(moderationPosition > memberPosition)){ + return interaction.reply({ + content: translate("moderation/ban:SUPERIOR"), + ephemeral: true + }); } if(!member.bannable) { - return message.error("moderation/ban:MISSING_PERM"); + return interaction.reply({ + content: translate("moderation/ban:MISSING_PERM"), + ephemeral: true + }); } } - await user.send(message.translate("moderation/ban:BANNED_DM", { + await user.send(translate("moderation/ban:BANNED_DM", { username: user.tag, - server: message.guild.name, - moderator: message.author.tag, + server: interaction.guild.name, + moderator: interaction.user.tag, reason })).catch(() => {}); // Ban the user - message.guild.members.ban(user, { reason } ).then(() => { + await interaction.guild.members.ban(user, { + reason + }).then(() => { // Send a success message in the current channel - message.sendT("moderation/ban:BANNED", { - username: user.tag, - server: message.guild.name, - moderator: message.author.tag, - reason + interaction.reply({ + content: translate("moderation/ban:BANNED", { + username: user.tag, + server: interaction.guild.name, + moderator: interaction.user.tag, + reason + }) }); const caseInfo = { - channel: message.channel.id, - moderator: message.author.id, + channel: interaction.channel.id, + moderator: interaction.user.id, date: Date.now(), type: "ban", - case: data.guild.casesCount, + case: data.guildData.casesCount, reason }; @@ -89,30 +117,31 @@ class Ban extends Command { memberData.save(); } - data.guild.casesCount++; - data.guild.save(); + data.guildData.casesCount++; + data.guildData.save(); - if(data.guild.plugins.modlogs){ - const channel = message.guild.channels.cache.get(data.guild.plugins.modlogs); + if(data.guildData.plugins.modlogs){ + const channel = interaction.guild.channels.cache.get(data.guildData.plugins.modlogs); if(!channel) return; const embed = new Discord.MessageEmbed() - .setAuthor(message.translate("moderation/ban:CASE", { - count: data.guild.casesCount + .setAuthor(translate("moderation/ban:CASE", { + count: data.guildData.casesCount })) - .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:REASON"), reason, true) + .addField(translate("common:USER"), `\`${user.tag}\` (${user.toString()})`, true) + .addField(translate("common:MODERATOR"), `\`${interaction.user.tag}\` (${interaction.user.toString()})`, true) + .addField(translate("common:REASON"), reason, true) .setColor("#e02316"); channel.send({ embeds: [embed] }); } }).catch((err) => { console.log(err); - return message.error("moderation/ban:MISSING_PERM"); + return interaction.reply({ + content: translate("moderation/ban:MISSING_PERM"), + ephemeral: true + }); }); } -} - -module.exports = Ban; +}; diff --git a/commands/Moderation/checkinvites.js b/commands/Moderation/checkinvites.js index 2c7b4b08ab..572d7d3d98 100644 --- a/commands/Moderation/checkinvites.js +++ b/commands/Moderation/checkinvites.js @@ -1,7 +1,7 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"); -class Checkinvites extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -9,7 +9,7 @@ class Checkinvites extends Command { dirname: __dirname, enabled: true, guildOnly: true, - aliases: [ "checkinvite", "checki" ], + memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -18,7 +18,7 @@ class Checkinvites extends Command { }); } - async run (message, args, data) { + async run (interaction, translate, data) { const members = message.guild.members; @@ -37,7 +37,7 @@ class Checkinvites extends Command { const text = (withInvite.length > 0 ? withInvite.map((m) => "`"+m.id+"` ("+m.tag+") : "+m.links).join("\n") - : message.translate("moderation/checkinvites:NOBODY")); + : translate("moderation/checkinvites:NOBODY")); const embed = new Discord.MessageEmbed() .setDescription(text) @@ -47,6 +47,4 @@ class Checkinvites extends Command { message.channel.send({ embeds: [embed] }); } -} - -module.exports = Checkinvites; \ No newline at end of file +}; diff --git a/commands/Moderation/clear-sanctions.js b/commands/Moderation/clear-sanctions.js index 23515f9f61..9d11d9da51 100644 --- a/commands/Moderation/clear-sanctions.js +++ b/commands/Moderation/clear-sanctions.js @@ -1,6 +1,6 @@ const Command = require("../../base/Command.js"); -class Clearsanctions extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -8,7 +8,7 @@ class Clearsanctions extends Command { dirname: __dirname, enabled: true, guildOnly: true, - aliases: [], + , memberPermissions: [ "MANAGE_MESSAGES" ], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -17,13 +17,16 @@ class Clearsanctions extends Command { }); } - async run (message, args) { + async run (interaction, translate) { const member = await this.client.resolveMember(args[0], message.guild); if(!member){ - return message.error("moderation/clear-sanctions:MISSING_MEMBER"); + return interaction.reply({ + content: translate("moderation/clear-sanctions:MISSING_MEMBER"), + ephemeral: true + }); } - const memberData = await this.client.findOrCreateMember({ id: member.id, guildID: message.guild.id }); + const memberData = await this.client.findOrCreateMember({ id: member.id, guildID: interaction.guild.id }); memberData.sanctions = []; memberData.save(); message.success("moderation/clear-sanctions:SUCCESS", { @@ -31,6 +34,4 @@ class Clearsanctions extends Command { }); } -} - -module.exports = Clearsanctions; \ No newline at end of file +}; diff --git a/commands/Moderation/clear.js b/commands/Moderation/clear.js index 780de4f58d..304b611b77 100644 --- a/commands/Moderation/clear.js +++ b/commands/Moderation/clear.js @@ -1,6 +1,6 @@ const Command = require("../../base/Command.js"); -class Clear extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -8,7 +8,7 @@ class Clear extends Command { dirname: __dirname, enabled: true, guildOnly: true, - aliases: [ "clear", "bulkdelete", "purge" ], + memberPermissions: [ "MANAGE_MESSAGES" ], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "MANAGE_MESSAGES" ], nsfw: false, @@ -17,27 +17,35 @@ class Clear extends Command { }); } - async run (message, args) { + async run (interaction, translate) { if(args[0] === "all"){ - message.sendT("moderation/clear:ALL_CONFIRM"); - await message.channel.awaitMessages((m) => (m.author.id === message.author.id) && (m.content === "-confirm"), { + interaction.reply({ + content: translate("moderation/clear:ALL_CONFIRM") + }); + await message.channel.awaitMessages((m) => (m.author.id === interaction.user.id) && (m.content === "-confirm"), { max: 1, time: 20000, errors: ["time"] }).catch(() => { - return message.error("misc:TIMES_UP"); + return interaction.reply({ + content: translate("misc:TIMES_UP"), + ephemeral: true + }); }); const position = message.channel.position; const newChannel = await message.channel.clone(); await message.channel.delete(); newChannel.setPosition(position); - return newChannel.send(message.translate("moderation/clear:CHANNEL_CLEARED")); + return newChannel.send(translate("moderation/clear:CHANNEL_CLEARED")); } let amount = args[0]; if(!amount || isNaN(amount) || parseInt(amount) < 1){ - return message.error("moderation/clear:MISSING_AMOUNT"); + return interaction.reply({ + content: translate("moderation/clear:MISSING_AMOUNT"), + ephemeral: true + }); } await message.delete(); @@ -76,6 +84,4 @@ class Clear extends Command { } -} - -module.exports = Clear; +}; diff --git a/commands/Moderation/giveaway.js b/commands/Moderation/giveaway.js index 7349fce80f..308eef1a1a 100644 --- a/commands/Moderation/giveaway.js +++ b/commands/Moderation/giveaway.js @@ -1,7 +1,7 @@ const Command = require("../../base/Command.js"), ms = require("ms"); -class Giveaway extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -9,7 +9,7 @@ class Giveaway extends Command { dirname: __dirname, enabled: true, guildOnly: true, - aliases: [ "gway" ], + memberPermissions: [ "MENTION_EVERYONE" ], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -18,34 +18,46 @@ class Giveaway extends Command { }); } - async run (message, args, data) { + async run (interaction, translate, data) { const status = args[0]; if(!status){ - return message.error("moderation/giveaway:MISSING_STATUS"); + return interaction.reply({ + content: translate("moderation/giveaway:MISSING_STATUS"), + ephemeral: true + }); } if(status === "create"){ - const currentGiveaways = this.client.giveawaysManager.giveaways.filter((g) => g.guildID === message.guild.id && !g.ended).length; + const currentGiveaways = this.client.giveawaysManager.giveaways.filter((g) => g.guildID === interaction.guild.id && !g.ended).length; if(currentGiveaways > 3){ - return message.error("moderation/giveaway:MAX_COUNT"); + return interaction.reply({ + content: translate("moderation/giveaway:MAX_COUNT"), + ephemeral: true + }); } const time = args[1]; if(!time){ return message.error("moderation/giveaway:INVALID_CREATE", { - prefix: data.guild.prefix + prefix: data.guildData.prefix }); } if(isNaN(ms(time))){ - return message.error("misc:INVALID_TIME"); + return interaction.reply({ + content: translate("misc:INVALID_TIME"), + ephemeral: true + }); } if(ms(time) > ms("15d")){ - return message.error("moderation/giveaway:MAX_DURATION"); + return interaction.reply({ + content: translate("moderation/giveaway:MAX_DURATION"), + ephemeral: true + }); } const winnersCount = args[2]; if(!winnersCount){ return message.error("moderation/giveaway:INVALID_CREATE", { - prefix: data.guild.prefix + prefix: data.guildData.prefix }); } if(isNaN(winnersCount) || winnersCount > 10 || winnersCount < 1){ @@ -57,7 +69,7 @@ class Giveaway extends Command { const prize = args.slice(3).join(" "); if(!prize){ return message.error("moderation/giveaway:INVALID_CREATE", { - prefix: data.guild.prefix + prefix: data.guildData.prefix }); } this.client.giveawaysManager.start(message.channel, { @@ -65,35 +77,42 @@ class Giveaway extends Command { prize: prize, winnerCount: parseInt(winnersCount, 10), messages: { - giveaway: message.translate("moderation/giveaway:TITLE"), - giveawayEnded: message.translate("moderation/giveaway:ENDED"), - timeRemaining: message.translate("moderation/giveaway:TIME_REMAINING"), - inviteToParticipate: message.translate("moderation/giveaway:INVITE_PARTICIPATE"), - winMessage: message.translate("moderation/giveaway:WIN_MESSAGE"), - embedFooter: message.translate("moderation/giveaway:FOOTER"), - noWinner: message.translate("moderation/giveaway:NO_WINNER"), - winners: message.translate("moderation/giveaway:WINNERS"), - endedAt: message.translate("moderation/giveaway:END_AT"), + giveaway: translate("moderation/giveaway:TITLE"), + giveawayEnded: translate("moderation/giveaway:ENDED"), + timeRemaining: translate("moderation/giveaway:TIME_REMAINING"), + inviteToParticipate: translate("moderation/giveaway:INVITE_PARTICIPATE"), + winMessage: translate("moderation/giveaway:WIN_MESSAGE"), + embedFooter: translate("moderation/giveaway:FOOTER"), + noWinner: translate("moderation/giveaway:NO_WINNER"), + winners: translate("moderation/giveaway:WINNERS"), + endedAt: translate("moderation/giveaway:END_AT"), units: { - seconds: message.translate("time:SECONDS", { amount: "" }).trim(), - minutes: message.translate("time:MINUTES", { amount: "" }).trim(), - hours: message.translate("time:HOURS", { amount: "" }).trim(), - days: message.translate("time:DAYS", { amount: "" }).trim() + seconds: translate("time:SECONDS", { amount: "" }).trim(), + minutes: translate("time:MINUTES", { amount: "" }).trim(), + hours: translate("time:HOURS", { amount: "" }).trim(), + days: translate("time:DAYS", { amount: "" }).trim() } } }).then(() => { - message.success("moderation/giveaway:GIVEAWAY_CREATED"); + interaction.reply({ + content: translate("moderation/giveaway:GIVEAWAY_CREATED") + }); }); } else if(status === "reroll"){ const messageID = args[1]; if(!messageID){ - return message.error("moderation/giveaway:MISSING_ID"); + return interaction.reply({ + content: translate("moderation/giveaway:MISSING_ID"), + ephemeral: true + }); } this.client.giveawaysManager.reroll(messageID, { - congrat: message.translate("moderation/giveaway:REROLL_CONGRAT"), - error: message.translate("moderation/giveaway:REROLL_ERROR") + congrat: translate("moderation/giveaway:REROLL_CONGRAT"), + error: translate("moderation/giveaway:REROLL_ERROR") }).then(() => { - return message.success("moderation/giveaway:GIVEAWAY_REROLLED"); + return interaction.reply({ + content: translate("moderation/giveaway:GIVEAWAY_REROLLED") + }); }).catch(() => { return message.error("moderation/giveaway:NOT_FOUND_ENDED", { messageID @@ -102,10 +121,15 @@ class Giveaway extends Command { } else if(status === "delete"){ const messageID = args[1]; if(!messageID){ - return message.error("moderation/giveaway:MISSING_ID"); + return interaction.reply({ + content: translate("moderation/giveaway:MISSING_ID"), + ephemeral: true + }); } this.client.giveawaysManager.delete(messageID).then(() => { - return message.success("moderation/giveaway:GIVEAWAY_DELETED"); + return interaction.reply({ + content: translate("moderation/giveaway:GIVEAWAY_DELETED") + }); }).catch(() => { return message.error("moderation/giveaway:NOT_FOUND", { messageID @@ -114,24 +138,30 @@ class Giveaway extends Command { } else if(status === "end"){ const messageID = args[1]; if(!messageID){ - return message.error("moderation/giveaway:MISSING_ID"); + return interaction.reply({ + content: translate("moderation/giveaway:MISSING_ID"), + ephemeral: true + }); } try { this.client.giveawaysManager.edit(messageID, { setEndTimestamp: Date.now() }); - return message.success("moderation/giveaway:GIVEAWAY_ENDED"); + return interaction.reply({ + content: translate("moderation/giveaway:GIVEAWAY_ENDED") + }); } catch(e){ return message.error("moderation/giveaway:NOT_FOUND", { messageID }); } } else { - return message.error("moderation/giveaway:MISSING_STATUS"); + return interaction.reply({ + content: translate("moderation/giveaway:MISSING_STATUS"), + ephemeral: true + }); } } -} - -module.exports = Giveaway; \ No newline at end of file +}; diff --git a/commands/Moderation/kick.js b/commands/Moderation/kick.js index 150945f289..58b147c7d3 100644 --- a/commands/Moderation/kick.js +++ b/commands/Moderation/kick.js @@ -1,7 +1,7 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"); -class Kick extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -9,7 +9,7 @@ class Kick extends Command { dirname: __dirname, enabled: true, guildOnly: true, - aliases: [], + , memberPermissions: [ "KICK_MEMBERS" ], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "KICK_MEMBERS" ], nsfw: false, @@ -18,39 +18,51 @@ class Kick extends Command { }); } - async run (message, args, data) { + async run (interaction, translate, data) { const member = await this.client.resolveMember(args[0], message.guild); if(!member){ - return message.error("moderation/kick:MISSING_MEMBER"); + return interaction.reply({ + content: translate("moderation/kick:MISSING_MEMBER"), + ephemeral: true + }); } - if(member.id === message.author.id){ - return message.error("moderation/ban:YOURSELF"); + if(member.id === interaction.user.id){ + return interaction.reply({ + content: translate("moderation/ban:YOURSELF"), + ephemeral: true + }); } - const memberData = await this.client.findOrCreateMember({ id: member.id, guildID: message.guild.id }); + const memberData = await this.client.findOrCreateMember({ id: member.id, guildID: interaction.guild.id }); // Gets the kcik reason let reason = args.slice(1).join(" "); if(!reason){ - reason = message.translate("misc:NO_REASON_PROVIDED"); + reason = translate("misc:NO_REASON_PROVIDED"); } const memberPosition = member.roles.highest.position; const moderationPosition = message.member.roles.highest.position; - if(message.member.ownerID !== message.author.id && !(moderationPosition > memberPosition)){ - return message.error("moderation/ban:SUPERIOR"); + if(message.member.ownerID !== interaction.user.id && !(moderationPosition > memberPosition)){ + return interaction.reply({ + content: translate("moderation/ban:SUPERIOR"), + ephemeral: true + }); } if(!member.kickable) { - return message.error("moderation/kick:MISSING_PERM"); + return interaction.reply({ + content: translate("moderation/kick:MISSING_PERM"), + ephemeral: true + }); } - await member.send(message.translate("moderation/kick:KICKED_DM", { + await member.send(translate("moderation/kick:KICKED_DM", { username: member.user.tag, server: message.guild.name, - moderator: message.author.tag, + moderator: interaction.user.tag, reason })).catch(() => {}); @@ -61,45 +73,46 @@ class Kick extends Command { message.sendT("moderation/kick:KICKED", { username: member.user.tag, server: message.guild.name, - moderator: message.author.tag, + moderator: interaction.user.tag, reason }); - data.guild.casesCount++; - data.guild.save(); + data.guildData.casesCount++; + data.guildData.save(); const caseInfo = { channel: message.channel.id, - moderator: message.author.id, + moderator: interaction.user.id, date: Date.now(), type: "kick", - case: data.guild.casesCount, + case: data.guildData.casesCount, reason, }; memberData.sanctions.push(caseInfo); memberData.save(); - if(data.guild.plugins.modlogs){ - const channel = message.guild.channels.cache.get(data.guild.plugins.modlogs); + if(data.guildData.plugins.modlogs){ + const channel = message.guild.channels.cache.get(data.guildData.plugins.modlogs); if(!channel) return; const embed = new Discord.MessageEmbed() - .setAuthor(message.translate("moderation/kick:CASE", { - count: data.guild.casesCount + .setAuthor(translate("moderation/kick:CASE", { + count: data.guildData.casesCount })) - .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:REASON"), reason, true) + .addField(translate("common:USER"), `\`${member.user.tag}\` (${member.user.toString()})`, true) + .addField(translate("common:MODERATOR"), `\`${interaction.user.tag}\` (${interaction.user.toString()})`, true) + .addField(translate("common:REASON"), reason, true) .setColor("#e88709"); channel.send({ embeds: [embed] }); } }).catch(() => { - return message.error("moderation/kick:MISSING_PERM"); + return interaction.reply({ + content: translate("moderation/kick:MISSING_PERM"), + ephemeral: true + }); }); } -} - -module.exports = Kick; +}; diff --git a/commands/Moderation/mute.js b/commands/Moderation/mute.js index 0feb4da037..7572d2c609 100644 --- a/commands/Moderation/mute.js +++ b/commands/Moderation/mute.js @@ -2,7 +2,7 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"), ms = require("ms"); -class Mute extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -10,7 +10,7 @@ class Mute extends Command { dirname: __dirname, enabled: true, guildOnly: true, - aliases: [], + , memberPermissions: [ "MANAGE_MESSAGES" ], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "MANAGE_CHANNELS" ], nsfw: false, @@ -19,33 +19,45 @@ class Mute extends Command { }); } - async run (message, args, data) { + async run (interaction, translate, data) { const member = await this.client.resolveMember(args[0], message.guild); if(!member){ - return message.error("moderation/mute:MISSING_MEMBER"); + return interaction.reply({ + content: translate("moderation/mute:MISSING_MEMBER"), + ephemeral: true + }); } - if(member.id === message.author.id){ - return message.error("moderation/ban:YOURSELF"); + if(member.id === interaction.user.id){ + return interaction.reply({ + content: translate("moderation/ban:YOURSELF"), + ephemeral: true + }); } const memberPosition = member.roles.highest.position; const moderationPosition = message.member.roles.highest.position; - if(message.member.ownerID !== message.author.id && !(moderationPosition > memberPosition)){ - return message.error("moderation/ban:SUPERIOR"); + if(message.member.ownerID !== interaction.user.id && !(moderationPosition > memberPosition)){ + return interaction.reply({ + content: translate("moderation/ban:SUPERIOR"), + ephemeral: true + }); } - const memberData = await this.client.findOrCreateMember({ id: member.id, guildID: message.guild.id }); + const memberData = await this.client.findOrCreateMember({ id: member.id, guildID: interaction.guild.id }); const time = args[1]; if(!time || isNaN(ms(time))){ - return message.error("misc:INVALID_TIME"); + return interaction.reply({ + content: translate("misc:INVALID_TIME"), + ephemeral: true + }); } let reason = args.slice(2).join(" "); if(!reason){ - reason = message.translate("misc:NO_REASON_PROVIDED"); + reason = translate("misc:NO_REASON_PROVIDED"); } message.guild.channels.cache.forEach((channel) => { @@ -56,10 +68,10 @@ class Mute extends Command { }).catch(() => {}); }); - member.send(message.translate("moderation/mute:MUTED_DM", { + member.send(translate("moderation/mute:MUTED_DM", { username: member.user.username, server: message.guild.name, - moderator: message.author.tag, + moderator: interaction.user.tag, time, reason })); @@ -67,54 +79,52 @@ class Mute extends Command { message.success("moderation/mute:MUTED", { username: member.user.tag, server: message.guild.name, - moderator: message.author.tag, + moderator: interaction.user.tag, time, reason }); - data.guild.casesCount++; + data.guildData.casesCount++; const caseInfo = { channel: message.channel.id, - moderator: message.author.id, + moderator: interaction.user.id, date: Date.now(), type: "mute", - case: data.guild.casesCount, + case: data.guildData.casesCount, reason, time }; memberData.mute.muted = true; memberData.mute.endDate = Date.now()+ms(time); - memberData.mute.case = data.guild.casesCount; + memberData.mute.case = data.guildData.casesCount; memberData.sanctions.push(caseInfo); memberData.markModified("sanctions"); memberData.markModified("mute"); await memberData.save(); - await data.guild.save(); + await data.guildData.save(); - this.client.databaseCache.mutedUsers.set(`${member.id}${message.guild.id}`, memberData); + this.client.databaseCache.mutedUsers.set(`${member.id}${interaction.guild.id}`, memberData); - if(data.guild.plugins.modlogs){ - const channel = message.guild.channels.cache.get(data.guild.plugins.modlogs); + if(data.guildData.plugins.modlogs){ + const channel = message.guild.channels.cache.get(data.guildData.plugins.modlogs); if(!channel) return; const embed = new Discord.MessageEmbed() - .setAuthor(message.translate("moderation/mute:CASE", { - count: data.guild.casesCount + .setAuthor(translate("moderation/mute:CASE", { + count: data.guildData.casesCount })) - .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:REASON"), reason, true) - .addField(message.translate("common:DURATION"), time, true) - .addField(message.translate("common:EXPIRY"), message.printDate(new Date(Date.now()+ms(time))), true) + .addField(translate("common:USER"), `\`${member.user.tag}\` (${member.user.toString()})`, true) + .addField(translate("common:MODERATOR"), `\`${interaction.user.tag}\` (${interaction.user.toString()})`, true) + .addField(translate("common:REASON"), reason, true) + .addField(translate("common:DURATION"), time, true) + .addField(translate("common:EXPIRY"), message.printDate(new Date(Date.now()+ms(time))), true) .setColor("#f44271"); channel.send({ embeds: [embed] }); } } -} - -module.exports = Mute; +}; diff --git a/commands/Moderation/poll.js b/commands/Moderation/poll.js index 379f45704f..73d9ae8233 100644 --- a/commands/Moderation/poll.js +++ b/commands/Moderation/poll.js @@ -1,7 +1,7 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"); -class Poll extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -9,7 +9,7 @@ class Poll extends Command { dirname: __dirname, enabled: true, guildOnly: true, - aliases: [], + , memberPermissions: [ "MENTION_EVERYONE" ], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -18,34 +18,41 @@ class Poll extends Command { }); } - async run (message, args, data) { + async run (interaction, translate, data) { const question = args.join(" "); if(!question){ - return message.error("moderation/poll:MISSING_QUESTION"); + return interaction.reply({ + content: translate("moderation/poll:MISSING_QUESTION"), + ephemeral: true + }); } message.delete().catch(() => {}); let mention = ""; - const msg = await message.sendT("moderation/announcement:MENTION_PROMPT"); + const msg = await interaction.reply({ + content: translate("moderation/announcement:MENTION_PROMPT") + }); - const collector = new Discord.MessageCollector(message.channel, (m) => m.author.id === message.author.id, { time: 240000 }); + const collector = new Discord.MessageCollector(message.channel, (m) => m.author.id === interaction.user.id, { time: 240000 }); collector.on("collect", async (tmsg) => { - if(tmsg.content.toLowerCase() === message.translate("common:NO").toLowerCase()){ + if(tmsg.content.toLowerCase() === translate("common:NO").toLowerCase()){ tmsg.delete(); msg.delete(); collector.stop(true); } - if(tmsg.content.toLowerCase() === message.translate("common:YES").toLowerCase()){ + if(tmsg.content.toLowerCase() === translate("common:YES").toLowerCase()){ tmsg.delete(); msg.delete(); - const tmsg1 = await message.sendT("moderation/announcement:MENTION_TYPE_PROMPT"); - const c = new Discord.MessageCollector(message.channel, (m) => m.author.id === message.author.id, { time: 60000 }); + const tmsg1 = await interaction.reply({ + content: translate("moderation/announcement:MENTION_TYPE_PROMPT") + }); + const c = new Discord.MessageCollector(message.channel, (m) => m.author.id === interaction.user.id, { time: 60000 }); c.on("collect", (m) => { if(m.content.toLowerCase() === "here"){ mention = "@here"; @@ -63,7 +70,10 @@ class Poll extends Command { }); c.on("end", (collected, reason) => { if(reason === "time"){ - return message.error("misc:TIMES_UP"); + return interaction.reply({ + content: translate("misc:TIMES_UP"), + ephemeral: true + }); } }); } @@ -72,7 +82,10 @@ class Poll extends Command { collector.on("end", (collected, reason) => { if(reason === "time"){ - return message.error("misc:TIMES_UP"); + return interaction.reply({ + content: translate("misc:TIMES_UP"), + ephemeral: true + }); } const success = this.client.customEmojis.success.split(":")[1]; @@ -84,9 +97,9 @@ class Poll extends Command { ]; const embed = new Discord.MessageEmbed() - .setAuthor(message.translate("moderation/poll:TITLE")) + .setAuthor(translate("moderation/poll:TITLE")) .setColor(data.config.embed.color) - .addField(question, message.translate("moderation/poll:REACT", { + .addField(question, translate("moderation/poll:REACT", { success: emojis[0].toString(), error: emojis[1].toString() })); @@ -99,6 +112,4 @@ class Poll extends Command { } -} - -module.exports = Poll; \ No newline at end of file +}; diff --git a/commands/Moderation/sanctions.js b/commands/Moderation/sanctions.js index 7da590fa3f..2aaabe5e12 100644 --- a/commands/Moderation/sanctions.js +++ b/commands/Moderation/sanctions.js @@ -1,7 +1,7 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"); -class Sanctions extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -9,7 +9,7 @@ class Sanctions extends Command { dirname: __dirname, enabled: true, guildOnly: true, - aliases: [ "warns", "see-warns", "view-warns", "see-sanctions", "view-sanctions", "infractions", "view-infractions", "see-infractions" ], + memberPermissions: [ "MANAGE_MESSAGES" ], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -18,13 +18,16 @@ class Sanctions extends Command { }); } - async run (message, args, data) { + async run (interaction, translate, data) { const user = await this.client.resolveUser(args[0]); if(!user){ - return message.error("moderation/sanctions:MISSING_MEMBER"); + return interaction.reply({ + content: translate("moderation/sanctions:MISSING_MEMBER"), + ephemeral: true + }); } - const memberData = await this.client.findOrCreateMember({ id: user.id, guildID: message.guild.id }); + const memberData = await this.client.findOrCreateMember({ id: user.id, guildID: interaction.guild.id }); const embed = new Discord.MessageEmbed() .setAuthor(user.tag, user.displayAvatarURL({ size: 512, dynamic: true, format: "png" })) @@ -32,19 +35,17 @@ class Sanctions extends Command { .setFooter(data.config.embed.footer); if(memberData.sanctions.length < 1){ - embed.setDescription(message.translate("moderation/sanctions:NO_SANCTION", { + embed.setDescription(translate("moderation/sanctions:NO_SANCTION", { username: user.tag })); return message.channel.send({ embeds: [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, `${translate("common:MODERATOR")}: <@${s.moderator}>\n${translate("common:REASON")}: ${s.reason}`, true); }); } message.channel.send({ embeds: [embed] }); } -} - -module.exports = Sanctions; +}; diff --git a/commands/Moderation/setwarns.js b/commands/Moderation/setwarns.js index f5b8494dc9..f117c612db 100644 --- a/commands/Moderation/setwarns.js +++ b/commands/Moderation/setwarns.js @@ -1,6 +1,6 @@ const Command = require("../../base/Command.js"); -class Setwarns extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -8,7 +8,7 @@ class Setwarns extends Command { dirname: __dirname, enabled: true, guildOnly: true, - aliases: [], + , memberPermissions: [ "MANAGE_GUILD" ], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "BAN_MEMBERS", "KICK_MEMBERS" ], nsfw: false, @@ -17,65 +17,72 @@ class Setwarns extends Command { }); } - async run (message, args, data) { + async run (interaction, translate, data) { const sanction = args[0]; if(!sanction || (sanction !== "kick" && sanction !== "ban")){ - return message.error("moderation/setwarns:MISSING_TYPE"); + return interaction.reply({ + content: translate("moderation/setwarns:MISSING_TYPE"), + ephemeral: true + }); } const number = args[1]; if(number === "reset"){ if(sanction === "kick"){ - data.guild.plugins.warnsSanctions.kick = false; - data.guild.markModified("plugins.warnsSanctions"); - data.guild.save(); + data.guildData.plugins.warnsSanctions.kick = false; + data.guildData.markModified("plugins.warnsSanctions"); + data.guildData.save(); return message.success("moderation/setwarns:SUCCESS_KICK_RESET", { - prefix: data.guild.prefix, + prefix: data.guildData.prefix, count: number }); } if(sanction === "ban"){ - data.guild.plugins.warnsSanctions.ban = false; - data.guild.markModified("plugins.warnsSanctions"); - data.guild.save(); + data.guildData.plugins.warnsSanctions.ban = false; + data.guildData.markModified("plugins.warnsSanctions"); + data.guildData.save(); return message.success("moderation/setwarns:SUCCESS_BAN_RESET", { - prefix: data.guild.prefix, + prefix: data.guildData.prefix, count: number }); } } if(!number || isNaN(number)){ - return message.error("misc:INVALID_NUMBER"); + return interaction.reply({ + content: translate("misc:INVALID_NUMBER"), + ephemeral: true + }); } if(number < 1 || number > 10){ - return message.error("misc:INVALID_NUMBER_RANGE", 1, 10); + return interaction.reply({ + content: translate("misc:INVALID_NUMBER_RANGE", 1, 10), + ephemeral: true + }); } if(sanction === "kick"){ - data.guild.plugins.warnsSanctions.kick = number; - data.guild.markModified("plugins.warnsSanctions"); - data.guild.save(); + data.guildData.plugins.warnsSanctions.kick = number; + data.guildData.markModified("plugins.warnsSanctions"); + data.guildData.save(); return message.success("moderation/setwarns:SUCCESS_KICK", { - prefix: data.guild.prefix, + prefix: data.guildData.prefix, count: number }); } if(sanction === "ban"){ - data.guild.plugins.warnsSanctions.ban = number; - data.guild.markModified("plugins.warnsSanctions"); - data.guild.save(); + data.guildData.plugins.warnsSanctions.ban = number; + data.guildData.markModified("plugins.warnsSanctions"); + data.guildData.save(); return message.success("moderation/setwarns:SUCCESS_BAN", { - prefix: data.guild.prefix, + prefix: data.guildData.prefix, count: number }); } } -} - -module.exports = Setwarns; \ No newline at end of file +}; diff --git a/commands/Moderation/unban.js b/commands/Moderation/unban.js index 6cdbc25fd2..30b15b9d77 100644 --- a/commands/Moderation/unban.js +++ b/commands/Moderation/unban.js @@ -1,6 +1,6 @@ const Command = require("../../base/Command.js"); -class Unban extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -17,12 +17,15 @@ class Unban extends Command { }); } - async run (message, args) { + async run (interaction, translate) { let user = null; if(!args[0]){ - return message.error("moderation/unban:MISSING_ID"); + return interaction.reply({ + content: translate("moderation/unban:MISSING_ID"), + ephemeral: true + }); } // Check if the arg is an ID or a username @@ -69,6 +72,4 @@ class Unban extends Command { } -} - -module.exports = Unban; \ No newline at end of file +}; diff --git a/commands/Moderation/unmute.js b/commands/Moderation/unmute.js index 98b9e42095..2881bf821c 100644 --- a/commands/Moderation/unmute.js +++ b/commands/Moderation/unmute.js @@ -1,6 +1,6 @@ const Command = require("../../base/Command.js"); -class Unmute extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -8,7 +8,7 @@ class Unmute extends Command { dirname: __dirname, enabled: true, guildOnly: true, - aliases: [], + , memberPermissions: [ "MANAGE_MESSAGES" ], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS", "MANAGE_CHANNELS" ], nsfw: false, @@ -17,20 +17,25 @@ class Unmute extends Command { }); } - async run (message, args) { + async run (interaction, translate) { const member = await this.client.resolveMember(args[0], message.guild); if(!member){ - return message.success("moderation/unmute:MISSING_MEMBER"); + return interaction.reply({ + content: translate("moderation/unmute:MISSING_MEMBER") + }); } const memberPosition = member.roles.highest.position; const moderationPosition = message.member.roles.highest.position; - if(message.member.ownerID !== message.author.id && !(moderationPosition > memberPosition)){ - return message.error("moderation/ban:SUPERIOR"); + if(message.member.ownerID !== interaction.user.id && !(moderationPosition > memberPosition)){ + return interaction.reply({ + content: translate("moderation/ban:SUPERIOR"), + ephemeral: true + }); } - const memberData = await this.client.findOrCreateMember({ id: member.id, guildID: message.guild.id }); + const memberData = await this.client.findOrCreateMember({ id: member.id, guildID: interaction.guild.id }); if(memberData.mute.muted){ memberData.mute.endDate = Date.now(); @@ -48,6 +53,4 @@ class Unmute extends Command { } -} - -module.exports = Unmute; \ No newline at end of file +}; diff --git a/commands/Moderation/warn.js b/commands/Moderation/warn.js index c632c9d826..b1dc0067fd 100644 --- a/commands/Moderation/warn.js +++ b/commands/Moderation/warn.js @@ -1,7 +1,7 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"); -class Warn extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -9,7 +9,7 @@ class Warn extends Command { dirname: __dirname, enabled: true, guildOnly: true, - aliases: [], + , memberPermissions: [ "MANAGE_MESSAGES" ], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -18,65 +18,80 @@ class Warn extends Command { }); } - async run (message, args, data) { + async run (interaction, translate, data) { const member = await this.client.resolveMember(args[0], message.guild); if(!member){ - return message.error("moderation/warn:MISSING_MEMBER"); + return interaction.reply({ + content: translate("moderation/warn:MISSING_MEMBER"), + ephemeral: true + }); } if(member.user.bot){ - return message.error("misc:BOT_USER"); + return interaction.reply({ + content: translate("misc:BOT_USER"), + ephemeral: true + }); } - const memberData = await this.client.findOrCreateMember({ id: member.id, guildID: message.guild.id }); + const memberData = await this.client.findOrCreateMember({ id: member.id, guildID: interaction.guild.id }); - if(member.id === message.author.id){ - return message.error("moderation/ban:YOURSELF"); + if(member.id === interaction.user.id){ + return interaction.reply({ + content: translate("moderation/ban:YOURSELF"), + ephemeral: true + }); } const memberPosition = member.roles.highest.position; const moderationPosition = message.member.roles.highest.position; - if(message.member.ownerID !== message.author.id && !(moderationPosition > memberPosition)){ - return message.error("moderation/ban:SUPERIOR"); + if(message.member.ownerID !== interaction.user.id && !(moderationPosition > memberPosition)){ + return interaction.reply({ + content: translate("moderation/ban:SUPERIOR"), + ephemeral: true + }); } const reason = args.slice(1).join(" "); if(!reason){ - return message.error("moderation/warn:MISSING_REASON"); + return interaction.reply({ + content: translate("moderation/warn:MISSING_REASON"), + ephemeral: true + }); } // Gets current member sanctions const sanctions = memberData.sanctions.filter((s) => s.type === "warn").length; - const banCount = data.guild.plugins.warnsSanctions.ban; - const kickCount = data.guild.plugins.warnsSanctions.kick; + const banCount = data.guildData.plugins.warnsSanctions.ban; + const kickCount = data.guildData.plugins.warnsSanctions.kick; - data.guild.casesCount++; - data.guild.save(); + data.guildData.casesCount++; + data.guildData.save(); const caseInfo = { channel: message.channel.id, - moderator: message.author.id, + moderator: interaction.user.id, date: Date.now(), type: "warn", - case: data.guild.casesCount, + case: data.guildData.casesCount, reason }; const embed = new Discord.MessageEmbed() - .addField(message.translate("common:USER"), `\`${member.user.tag}\` (${member.user.toString()})`) - .addField(message.translate("common:MODERATOR"), `\`${message.author.tag}\` (${message.author.toString()}`) - .addField(message.translate("common:REASON"), reason, true); + .addField(translate("common:USER"), `\`${member.user.tag}\` (${member.user.toString()})`) + .addField(translate("common:MODERATOR"), `\`${interaction.user.tag}\` (${interaction.user.toString()}`) + .addField(translate("common:REASON"), reason, true); if(banCount){ if(sanctions >= banCount){ - member.send(message.translate("moderation/ban:BANNED_DM", { + member.send(translate("moderation/ban:BANNED_DM", { username: member.user, - moderator: message.author.tag, + moderator: interaction.user.tag, server: message.guild.name, reason })); caseInfo.type = "ban"; - embed.setAuthor(message.translate("moderation/ban:CASE", { - count: data.guild.casesCount + embed.setAuthor(translate("moderation/ban:CASE", { + count: data.guildData.casesCount })) .setColor("#e02316"); message.guild.members.ban(member).catch(() => {}); @@ -89,15 +104,15 @@ class Warn extends Command { if(kickCount){ if(sanctions >= kickCount){ - member.send(message.translate("moderation/kick:KICKED_DM", { + member.send(translate("moderation/kick:KICKED_DM", { username: member.user, - moderator: message.author.tag, + moderator: interaction.user.tag, server: message.guild.name, reason })); caseInfo.type = "kick"; - embed.setAuthor(message.translate("moderation/kick:CASE", { - count: data.guild.casesCount + embed.setAuthor(translate("moderation/kick:CASE", { + count: data.guildData.casesCount })) .setColor("#e88709"); member.kick().catch(() => {}); @@ -108,15 +123,15 @@ class Warn extends Command { } } - member.send(message.translate("moderation/warn:WARNED_DM", { + member.send(translate("moderation/warn:WARNED_DM", { username: member.user.tag, server: message.guild.name, - moderator: message.author.tag, + moderator: interaction.user.tag, reason })); caseInfo.type = "warn"; - embed.setAuthor(message.translate("moderation/warn:CASE", { - caseNumber: data.guild.casesCount + embed.setAuthor(translate("moderation/warn:CASE", { + caseNumber: data.guildData.casesCount })) .setColor("#8c14e2"); message.success("moderation/warn:WARNED", { @@ -127,13 +142,11 @@ class Warn extends Command { memberData.sanctions.push(caseInfo); memberData.save(); - if(data.guild.plugins.modlogs){ - const channel = message.guild.channels.cache.get(data.guild.plugins.modlogs); + if(data.guildData.plugins.modlogs){ + const channel = message.guild.channels.cache.get(data.guildData.plugins.modlogs); if(!channel) return; channel.send({ embeds: [embed] }); } } -} - -module.exports = Warn; +}; diff --git a/commands/Music/autoplay.js b/commands/Music/autoplay.js index a0471e762b..f548bd2c2c 100644 --- a/commands/Music/autoplay.js +++ b/commands/Music/autoplay.js @@ -1,6 +1,6 @@ const Command = require("../../base/Command.js"); -class AutoPlay extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -8,7 +8,7 @@ class AutoPlay extends Command { dirname: __dirname, enabled: true, guildOnly: true, - aliases: [], + , memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -23,21 +23,27 @@ class AutoPlay extends Command { const voice = message.member.voice.channel; if (!voice){ - return message.error("music/play:NO_VOICE_CHANNEL"); + return interaction.reply({ + content: translate("music/play:NO_VOICE_CHANNEL"), + ephemeral: true + }); } if(!queue){ - return message.error("music:play:NOT_PLAYING"); + return interaction.reply({ + content: translate("music:play:NOT_PLAYING"), + ephemeral: true + }); } // Gets the current song await this.client.player.setAutoPlay(message, !queue.autoPlay); // Send the embed in the current channel - message.sendT(`music/autoplay:SUCCESS_${queue.autoPlay ? "ENABLED" : "DISABLED"}`); + interaction.reply({ + content: translate(`music/autoplay:SUCCESS_${queue.autoPlay ? "ENABLED" : "DISABLED"}`) + }); } -} - -module.exports = AutoPlay; \ No newline at end of file +}; diff --git a/commands/Music/back.js b/commands/Music/back.js index 5e47d2d597..a6a8cc419d 100644 --- a/commands/Music/back.js +++ b/commands/Music/back.js @@ -1,7 +1,7 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"); -class Back extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -9,7 +9,7 @@ class Back extends Command { dirname: __dirname, enabled: true, guildOnly: true, - aliases: [ "previous" ], + memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -18,27 +18,36 @@ class Back extends Command { }); } - async run (message, args, data) { + async run (interaction, translate, data) { const queue = this.client.player.getQueue(message); const voice = message.member.voice.channel; if (!voice){ - return message.error("music/play:NO_VOICE_CHANNEL"); + return interaction.reply({ + content: translate("music/play:NO_VOICE_CHANNEL"), + ephemeral: true + }); } if(!queue){ - return message.error("music/play:NOT_PLAYING"); + return interaction.reply({ + content: translate("music/play:NOT_PLAYING"), + ephemeral: true + }); } if(!queue.previousTracks[0]){ - return message.error("music/back:NO_PREV_SONG"); + return interaction.reply({ + content: translate("music/back:NO_PREV_SONG"), + ephemeral: true + }); } const members = voice.members.filter((m) => !m.user.bot); const embed = new Discord.MessageEmbed() - .setAuthor(message.translate("music/back:DESCRIPTION")) + .setAuthor(translate("music/back:DESCRIPTION")) .setThumbnail(queue.tracks[0].thumbnail) .setFooter(data.config.embed.footer) .setColor(data.config.embed.color); @@ -51,7 +60,7 @@ class Back extends Command { const mustVote = Math.floor(members.size/2+1); - embed.setDescription(message.translate("music/back:VOTE_CONTENT", { + embed.setDescription(translate("music/back:VOTE_CONTENT", { songName: queue.tracks[0].name, voteCount: 0, requiredCount: mustVote @@ -74,11 +83,11 @@ class Back extends Command { const haveVoted = reaction.count-1; if(haveVoted >= mustVote){ this.client.player.back(message); - embed.setDescription(message.translate("music/back:SUCCESS")); + embed.setDescription(translate("music/back:SUCCESS")); m.edit({ embeds: [embed] }); collector.stop(true); } else { - embed.setDescription(message.translate("music/back:VOTE_CONTENT", { + embed.setDescription(translate("music/back:VOTE_CONTENT", { songName: queue.tracks[0].title, voteCount: haveVoted, requiredCount: mustVote @@ -89,18 +98,19 @@ class Back extends Command { collector.on("end", (collected, isDone) => { if(!isDone){ - return message.error("misc:TIMES_UP"); + return interaction.reply({ + content: translate("misc:TIMES_UP"), + ephemeral: true + }); } }); } else { this.client.player.back(message); - embed.setDescription(message.translate("music/back:SUCCESS")); + embed.setDescription(translate("music/back:SUCCESS")); m.edit({ embeds: [embed] }); } } -} - -module.exports = Back; +}; diff --git a/commands/Music/filter.js b/commands/Music/filter.js index e40e061588..04f8ea2380 100644 --- a/commands/Music/filter.js +++ b/commands/Music/filter.js @@ -1,7 +1,7 @@ const Command = require("../../base/Command.js"), FiltersList = require("../../assets/json/filters.json"); -class Filter extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -9,7 +9,7 @@ class Filter extends Command { dirname: __dirname, enabled: true, guildOnly: true, - aliases: [ "f" ], + memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -18,28 +18,34 @@ class Filter extends Command { }); } - async run (message, args, data) { + async run (interaction, translate, data) { const queue = this.client.player.getQueue(message); const voice = message.member.voice.channel; if (!voice){ - return message.error("music/play:NO_VOICE_CHANNEL"); + return interaction.reply({ + content: translate("music/play:NO_VOICE_CHANNEL"), + ephemeral: true + }); } if(!queue){ - return message.error("music/play:NOT_PLAYING"); + return interaction.reply({ + content: translate("music/play:NOT_PLAYING"), + ephemeral: true + }); } const filter = args[0]; if(!filter) return message.error("music/filter:MISSING_FILTER", { - prefix: data.guild.prefix + prefix: data.guildData.prefix }); const filterToUpdate = Object.values(FiltersList).find((f) => f.toLowerCase() === filter.toLowerCase()); if(!filterToUpdate) return message.error("music/filter:UNKNOWN_FILTER", { - prefix: data.guild.prefix + prefix: data.guildData.prefix }); const filterRealName = Object.keys(FiltersList).find((f) => FiltersList[f] === filterToUpdate); @@ -49,10 +55,13 @@ class Filter extends Command { filtersUpdated[filterRealName] = queueFilters[filterRealName] ? false : true; this.client.player.setFilters(message, filtersUpdated); - if(filtersUpdated[filterRealName]) message.success("music/filter:ADDING_FILTER"); - else message.success("music/filter:REMOVING_FILTER"); + if(filtersUpdated[filterRealName]) interaction.reply({ +content: translate("music/filter:ADDING_FILTER") +});; + else interaction.reply({ +content: translate("music/filter:REMOVING_FILTER") +});; } } -module.exports = Filter; \ No newline at end of file diff --git a/commands/Music/filters.js b/commands/Music/filters.js index 377b735f0b..4e96c14cd9 100644 --- a/commands/Music/filters.js +++ b/commands/Music/filters.js @@ -2,7 +2,7 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"), FiltersList = require("../../assets/json/filters.json"); -class Filters extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -10,7 +10,7 @@ class Filters extends Command { dirname: __dirname, enabled: true, guildOnly: true, - aliases: [], + , memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -19,17 +19,23 @@ class Filters extends Command { }); } - async run (message, args, data) { + async run (interaction, translate, data) { const queue = this.client.player.getQueue(message); const voice = message.member.voice.channel; if (!voice){ - return message.error("music/play:NO_VOICE_CHANNEL"); + return interaction.reply({ + content: translate("music/play:NO_VOICE_CHANNEL"), + ephemeral: true + }); } if(!queue){ - return message.error("music/play:NOT_PLAYING"); + return interaction.reply({ + content: translate("music/play:NOT_PLAYING"), + ephemeral: true + }); } const filtersStatuses = [ [], [] ]; @@ -40,16 +46,14 @@ class Filters extends Command { }); const list = new Discord.MessageEmbed() - .setDescription(message.translate("music/filters:CONTENT", { - prefix: data.guild.prefix + .setDescription(translate("music/filters:CONTENT", { + prefix: data.guildData.prefix })) - .addField(message.translate("music/filters:TITLE"), filtersStatuses[0].join("\n"), true) + .addField(translate("music/filters:TITLE"), filtersStatuses[0].join("\n"), true) .addField("** **", filtersStatuses[1].join("\n"), true) .setColor(data.config.embed.color); message.channel.send({ embeds: [list] }); } -} - -module.exports = Filters; \ No newline at end of file +}; diff --git a/commands/Music/lyrics.js b/commands/Music/lyrics.js index 3931f0cc72..8ef28d2908 100644 --- a/commands/Music/lyrics.js +++ b/commands/Music/lyrics.js @@ -2,7 +2,7 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"), lyricsParse = require("lyrics-finder"); -class Lyrics extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -10,7 +10,7 @@ class Lyrics extends Command { dirname: __dirname, enabled: true, guildOnly: false, - aliases: [ "paroles" ], + memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -19,15 +19,18 @@ class Lyrics extends Command { }); } - async run (message, args, data) { + async run (interaction, translate, data) { const [songName, artistName] = args.join(" ").split("|"); if(!songName){ - return message.error("music/lyrics:MISSING_SONG_NAME"); + return interaction.reply({ + content: translate("music/lyrics:MISSING_SONG_NAME"), + ephemeral: true + }); } const embed = new Discord.MessageEmbed() - .setAuthor(message.translate("music/lyrics:LYRICS_OF", { + .setAuthor(translate("music/lyrics:LYRICS_OF", { songName })) .setColor(data.config.embed.color) @@ -43,7 +46,7 @@ class Lyrics extends Command { let lyrics = await lyricsParse(songNameFormated, artistName) || "Not Found!"; 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) + translate("music/lyrics:AND_MORE") + " ["+translate("music/lyrics:CLICK_HERE")+"]"+`https://www.musixmatch.com/search/${songName}`; } else if(!lyrics.length) { return message.error("music/lyrics:NO_LYRICS_FOUND", { songName @@ -62,6 +65,4 @@ class Lyrics extends Command { } -} - -module.exports = Lyrics; \ No newline at end of file +}; diff --git a/commands/Music/np.js b/commands/Music/np.js index 1b3d1fcd01..8802e66bc2 100644 --- a/commands/Music/np.js +++ b/commands/Music/np.js @@ -1,7 +1,7 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"); -class Np extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -9,7 +9,7 @@ class Np extends Command { dirname: __dirname, enabled: true, guildOnly: true, - aliases: [ "nowplaying", "now-playing" ], + memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -18,17 +18,23 @@ class Np extends Command { }); } - async run (message, args, data) { + async run (interaction, translate, data) { const queue = this.client.player.getQueue(message); const voice = message.member.voice.channel; if (!voice){ - return message.error("music/play:NO_VOICE_CHANNEL"); + return interaction.reply({ + content: translate("music/play:NO_VOICE_CHANNEL"), + ephemeral: true + }); } if(!queue){ - return message.error("music/play:NOT_PLAYING"); + return interaction.reply({ + content: translate("music/play:NOT_PLAYING"), + ephemeral: true + }); } // Gets the current song @@ -36,14 +42,14 @@ class Np extends Command { // Generate discord embed to display song informations const embed = new Discord.MessageEmbed() - .setAuthor(message.translate("music/np:CURRENTLY_PLAYING")) + .setAuthor(translate("music/np:CURRENTLY_PLAYING")) .setThumbnail(track.thumbnail) - .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"), + .addField(translate("music/np:T_TITLE"), track.title, true) + .addField(translate("music/np:T_CHANNEL"), track.author, true) + .addField(translate("music/np:T_DURATION"), message.convertTime(Date.now()+track.durationMS, "to", true), true) + .addField(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) + (track.description.substring(0, 150)+"\n"+(translate("common:AND_MORE").toLowerCase())) : translate("music/np:NO_DESCRIPTION"), true) .addField("\u200B", this.client.player.createProgressBar(message, { timecodes: true })) .setTimestamp() .setColor(data.config.embed.color) @@ -54,6 +60,4 @@ class Np extends Command { } -} - -module.exports = Np; \ No newline at end of file +}; diff --git a/commands/Music/pause.js b/commands/Music/pause.js index 07ac32216f..bba44a243e 100644 --- a/commands/Music/pause.js +++ b/commands/Music/pause.js @@ -1,6 +1,6 @@ const Command = require("../../base/Command.js"); -class Pause extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -8,7 +8,7 @@ class Pause extends Command { dirname: __dirname, enabled: true, guildOnly: true, - aliases: [], + , memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -23,21 +23,27 @@ class Pause extends Command { const voice = message.member.voice.channel; if (!voice){ - return message.error("music/play:NO_VOICE_CHANNEL"); + return interaction.reply({ + content: translate("music/play:NO_VOICE_CHANNEL"), + ephemeral: true + }); } if(!queue){ - return message.error("music:play:NOT_PLAYING"); + return interaction.reply({ + content: translate("music:play:NOT_PLAYING"), + ephemeral: true + }); } // Gets the current song await this.client.player.pause(message); // Send the embed in the current channel - message.sendT("music/pause:SUCCESS"); + interaction.reply({ + content: translate("music/pause:SUCCESS") + }); } -} - -module.exports = Pause; \ No newline at end of file +}; diff --git a/commands/Music/play.js b/commands/Music/play.js index 428798ab87..dbcc4a15b5 100644 --- a/commands/Music/play.js +++ b/commands/Music/play.js @@ -1,6 +1,6 @@ const Command = require("../../base/Command.js"); -class Play extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -8,7 +8,7 @@ class Play extends Command { dirname: __dirname, enabled: true, guildOnly: true, - aliases: [ "joue" ], + memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -17,27 +17,36 @@ class Play extends Command { }); } - async run (message, args) { + async run (interaction, translate) { const name = args.join(" "); if(!name){ - return message.error("music/play:MISSING_SONG_NAME"); + return interaction.reply({ + content: translate("music/play:MISSING_SONG_NAME"), + ephemeral: true + }); } const voice = message.member.voice.channel; if(!voice){ - return message.error("music/play:NO_VOICE_CHANNEL"); + return interaction.reply({ + content: translate("music/play:NO_VOICE_CHANNEL"), + ephemeral: true + }); } // Check my permissions const perms = voice.permissionsFor(this.client.user); if(!perms.has("CONNECT") || !perms.has("SPEAK")){ - return message.error("music/play:VOICE_CHANNEL_CONNECT"); + return interaction.reply({ + content: translate("music/play:VOICE_CHANNEL_CONNECT"), + ephemeral: true + }); } - await this.client.player.play(message, args.join(" ")); + await this.client.player.play(interaction, translate.join(" ")); } -} +}; -module.exports = Play; \ No newline at end of file + diff --git a/commands/Music/queue.js b/commands/Music/queue.js index 95ba1894db..2e015fcdf8 100644 --- a/commands/Music/queue.js +++ b/commands/Music/queue.js @@ -2,7 +2,7 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"), Pagination = require("discord-paginationembed"); -class Queue extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -10,7 +10,7 @@ class Queue extends Command { dirname: __dirname, enabled: true, guildOnly: true, - aliases: [ "playlist" ], + memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -19,24 +19,30 @@ class Queue extends Command { }); } - async run (message, args, data) { + async run (interaction, translate, data) { const voice = message.member.voice.channel; if (!voice){ - return message.error("music/play:NO_VOICE_CHANNEL"); + return interaction.reply({ + content: translate("music/play:NO_VOICE_CHANNEL"), + ephemeral: true + }); } const queue = this.client.player.getQueue(message); if(!queue){ - return message.error("music/play:NOT_PLAYING"); + return interaction.reply({ + content: translate("music/play:NOT_PLAYING"), + ephemeral: true + }); } if(queue.tracks.length === 1){ const embed = new Discord.MessageEmbed() .setColor(data.config.embed.color) - .setAuthor(message.translate("music/queue:TITLE"), message.guild.iconURL({ dynamic: true })) - .addField(message.translate("music/np:CURRENTLY_PLAYING"), `[${queue.tracks[0].title}](${queue.tracks[0].url})\n*Requested by ${queue.tracks[0].requestedBy}*\n`); + .setAuthor(translate("music/queue:TITLE"), message.guild.iconURL({ dynamic: true })) + .addField(translate("music/np:CURRENTLY_PLAYING"), `[${queue.tracks[0].title}](${queue.tracks[0].url})\n*Requested by ${queue.tracks[0].requestedBy}*\n`); return message.channel.send({ embeds: [embed] }); } let i = 0; @@ -45,11 +51,11 @@ class Queue extends Command { FieldsEmbed.embed .setColor(data.config.embed.color) - .setAuthor(message.translate("music/queue:TITLE"), message.guild.iconURL({ dynamic: true })) - .addField(message.translate("music/np:CURRENTLY_PLAYING"), `[${queue.tracks[0].title}](${queue.tracks[0].url})\n*Requested by ${queue.tracks[0].requestedBy}*\n`); + .setAuthor(translate("music/queue:TITLE"), message.guild.iconURL({ dynamic: true })) + .addField(translate("music/np:CURRENTLY_PLAYING"), `[${queue.tracks[0].title}](${queue.tracks[0].url})\n*Requested by ${queue.tracks[0].requestedBy}*\n`); FieldsEmbed.setArray(queue.tracks[1] ? queue.tracks.slice(1, queue.tracks.length) : []) - .setAuthorizedUsers([message.author.id]) + .setAuthorizedUsers([interaction.user.id]) .setChannel(message.channel) .setElementsPerPage(5) .setPageIndicator(true) @@ -59,6 +65,4 @@ class Queue extends Command { } -} - -module.exports = Queue; \ No newline at end of file +}; diff --git a/commands/Music/resume.js b/commands/Music/resume.js index e8abf0bb9b..f70fda3382 100644 --- a/commands/Music/resume.js +++ b/commands/Music/resume.js @@ -1,6 +1,6 @@ const Command = require("../../base/Command.js"); -class Resume extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -8,7 +8,7 @@ class Resume extends Command { dirname: __dirname, enabled: true, guildOnly: true, - aliases: [], + , memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -23,20 +23,26 @@ class Resume extends Command { const voice = message.member.voice.channel; if (!voice){ - return message.error("music/play:NO_VOICE_CHANNEL"); + return interaction.reply({ + content: translate("music/play:NO_VOICE_CHANNEL"), + ephemeral: true + }); } if(!queue){ - return message.error("music:play:NOT_PLAYING"); + return interaction.reply({ + content: translate("music:play:NOT_PLAYING"), + ephemeral: true + }); } // Gets the current song await this.client.player.resume(message); // Send the embed in the current channel - message.sendT("music/resume:SUCCESS"); + interaction.reply({ + content: translate("music/resume:SUCCESS") + }); } -} - -module.exports = Resume; \ No newline at end of file +}; diff --git a/commands/Music/seek.js b/commands/Music/seek.js index cfa33a4559..d47374e72b 100644 --- a/commands/Music/seek.js +++ b/commands/Music/seek.js @@ -1,7 +1,7 @@ const Command = require("../../base/Command.js"); const ms = require("ms"); -class Seek extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -9,7 +9,7 @@ class Seek extends Command { dirname: __dirname, enabled: true, guildOnly: true, - aliases: [], + , memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -18,31 +18,40 @@ class Seek extends Command { }); } - async run (message, args) { + async run (interaction, translate) { const queue = this.client.player.getQueue(message); const voice = message.member.voice.channel; if (!voice){ - return message.error("music/play:NO_VOICE_CHANNEL"); + return interaction.reply({ + content: translate("music/play:NO_VOICE_CHANNEL"), + ephemeral: true + }); } if(!queue){ - return message.error("music/play:NOT_PLAYING"); + return interaction.reply({ + content: translate("music/play:NOT_PLAYING"), + ephemeral: true + }); } const time = ms(args[0]); if (isNaN(time)) { - return message.error("music/seek:INVALID_TIME"); + return interaction.reply({ + content: translate("music/seek:INVALID_TIME"), + ephemeral: true + }); } // Change the song position await this.client.player.setPosition(message, queue.currentStreamTime + time); // Send the embed in the current channel - message.sendT("music/seek:SUCCESS"); + interaction.reply({ + content: translate("music/seek:SUCCESS") + }); } -} - -module.exports = Seek; \ No newline at end of file +}; diff --git a/commands/Music/skip.js b/commands/Music/skip.js index 9d5649bc86..f9ae60ed79 100644 --- a/commands/Music/skip.js +++ b/commands/Music/skip.js @@ -1,7 +1,7 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"); -class Skip extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -9,7 +9,7 @@ class Skip extends Command { dirname: __dirname, enabled: true, guildOnly: true, - aliases: [ "next" ], + memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -18,27 +18,36 @@ class Skip extends Command { }); } - async run (message, args, data) { + async run (interaction, translate, data) { const queue = this.client.player.getQueue(message); const voice = message.member.voice.channel; if (!voice){ - return message.error("music/play:NO_VOICE_CHANNEL"); + return interaction.reply({ + content: translate("music/play:NO_VOICE_CHANNEL"), + ephemeral: true + }); } if(!queue){ - return message.error("music/play:NOT_PLAYING"); + return interaction.reply({ + content: translate("music/play:NOT_PLAYING"), + ephemeral: true + }); } if(!queue.tracks[0]){ - return message.error("music/skip:NO_NEXT_SONG"); + return interaction.reply({ + content: translate("music/skip:NO_NEXT_SONG"), + ephemeral: true + }); } const members = voice.members.filter((m) => !m.user.bot); const embed = new Discord.MessageEmbed() - .setAuthor(message.translate("music/skip:DESCRIPTION")) + .setAuthor(translate("music/skip:DESCRIPTION")) .setThumbnail(queue.tracks[0].thumbnail) .setFooter(data.config.embed.footer) .setColor(data.config.embed.color); @@ -51,7 +60,7 @@ class Skip extends Command { const mustVote = Math.floor(members.size/2+1); - embed.setDescription(message.translate("music/skip:VOTE_CONTENT", { + embed.setDescription(translate("music/skip:VOTE_CONTENT", { songName: queue.tracks[0].name, voteCount: 0, requiredCount: mustVote @@ -74,11 +83,11 @@ class Skip extends Command { const haveVoted = reaction.count-1; if(haveVoted >= mustVote){ this.client.player.skip(message); - embed.setDescription(message.translate("music/skip:SUCCESS")); + embed.setDescription(translate("music/skip:SUCCESS")); m.edit({ embeds: [embed] }); collector.stop(true); } else { - embed.setDescription(message.translate("music/skip:VOTE_CONTENT", { + embed.setDescription(translate("music/skip:VOTE_CONTENT", { songName: queue.tracks[0].title, voteCount: haveVoted, requiredCount: mustVote @@ -89,18 +98,19 @@ class Skip extends Command { collector.on("end", (collected, isDone) => { if(!isDone){ - return message.error("misc:TIMES_UP"); + return interaction.reply({ + content: translate("misc:TIMES_UP"), + ephemeral: true + }); } }); } else { this.client.player.skip(message); - embed.setDescription(message.translate("music/skip:SUCCESS")); + embed.setDescription(translate("music/skip:SUCCESS")); m.edit({ embeds: [embed] }); } } -} - -module.exports = Skip; +}; diff --git a/commands/Music/stop.js b/commands/Music/stop.js index d75ea6b93e..56543463eb 100644 --- a/commands/Music/stop.js +++ b/commands/Music/stop.js @@ -1,7 +1,7 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"); -class Stop extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -9,7 +9,7 @@ class Stop extends Command { dirname: __dirname, enabled: true, guildOnly: true, - aliases: [ "leave" ], + memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -18,23 +18,29 @@ class Stop extends Command { }); } - async run (message, args, data) { + async run (interaction, translate, data) { const queue = await this.client.player.getQueue(message); const voice = message.member.voice.channel; if(!voice){ - return message.error("music/play:NO_VOICE_CHANNEL"); + return interaction.reply({ + content: translate("music/play:NO_VOICE_CHANNEL"), + ephemeral: true + }); } if(!queue){ - return message.error("music/play:NOT_PLAYING"); + return interaction.reply({ + content: translate("music/play:NOT_PLAYING"), + ephemeral: true + }); } const members = voice.members.filter((m) => !m.user.bot); const embed = new Discord.MessageEmbed() - .setAuthor(message.translate("music/stop:DESCRIPTION")) + .setAuthor(translate("music/stop:DESCRIPTION")) .setFooter(data.config.embed.footer) .setColor(data.config.embed.color); @@ -46,7 +52,7 @@ class Stop extends Command { const mustVote = Math.floor(members.size/2+1); - embed.setDescription(message.translate("music/stop:VOTE_CONTENT", { + embed.setDescription(translate("music/stop:VOTE_CONTENT", { voteCount: 0, requiredCount: mustVote })); @@ -68,11 +74,11 @@ class Stop extends Command { const haveVoted = reaction.count-1; if(haveVoted >= mustVote){ this.client.player.stop(message); - embed.setDescription(message.translate("music/stop:SUCCESS")); + embed.setDescription(translate("music/stop:SUCCESS")); m.edit({ embeds: [embed] }); collector.stop(true); } else { - embed.setDescription(message.translate("music/stop:VOTE_CONTENT", { + embed.setDescription(translate("music/stop:VOTE_CONTENT", { voteCount: haveVoted, requiredCount: mustVote })); @@ -82,18 +88,19 @@ class Stop extends Command { collector.on("end", (collected, isDone) => { if(!isDone){ - return message.error("misc:TIMES_UP"); + return interaction.reply({ + content: translate("misc:TIMES_UP"), + ephemeral: true + }); } }); } else { this.client.player.stop(message); - embed.setDescription(message.translate("music/stop:SUCCESS")); + embed.setDescription(translate("music/stop:SUCCESS")); m.edit({ embeds: [embed] }); } } -} - -module.exports = Stop; +}; diff --git a/commands/Owner/eval.js b/commands/Owner/eval.js index 3b1e22209c..4225a283eb 100644 --- a/commands/Owner/eval.js +++ b/commands/Owner/eval.js @@ -1,6 +1,6 @@ const Command = require("../../base/Command.js"); -class Eval extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -8,7 +8,7 @@ class Eval extends Command { dirname: __dirname, enabled: true, guildOnly: false, - aliases: [], + , memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -18,7 +18,7 @@ class Eval extends Command { } // eslint-disable-next-line no-unused-vars - async run (message, args, data) { + async run (interaction, translate, data) { // eslint-disable-next-line no-unused-vars const usersData = this.client.usersData; @@ -50,6 +50,4 @@ class Eval extends Command { } -} - -module.exports = Eval; \ No newline at end of file +}; diff --git a/commands/Owner/reload.js b/commands/Owner/reload.js index 5d9e013c1a..bb3f4ed89f 100644 --- a/commands/Owner/reload.js +++ b/commands/Owner/reload.js @@ -1,6 +1,6 @@ const Command = require("../../base/Command.js"); -class Reload extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -8,7 +8,7 @@ class Reload extends Command { dirname: __dirname, enabled: true, guildOnly: false, - aliases: [], + , memberPermissions: [], botPermissions: [], nsfw: false, @@ -17,7 +17,7 @@ class Reload extends Command { }); } - async run (message, args) { + async run (interaction, translate) { const command = args[0]; const cmd = this.client.commands.get(command) || this.client.commands.get(this.client.aliases.get(command)); if(!cmd){ @@ -32,6 +32,4 @@ class Reload extends Command { }); } -} - -module.exports = Reload; \ No newline at end of file +}; diff --git a/commands/Owner/servers-list.js b/commands/Owner/servers-list.js index ecf6f19f6f..0b93ee9c46 100644 --- a/commands/Owner/servers-list.js +++ b/commands/Owner/servers-list.js @@ -1,7 +1,7 @@ const Command = require("../../base/Command.js"), Discord = require("discord.js"); -class ServersList extends Command { +module.exports = class extends Command { constructor (client) { super(client, { @@ -9,7 +9,7 @@ class ServersList extends Command { dirname: __dirname, enabled: true, guildOnly: false, - aliases: [ "slist" ], + memberPermissions: [], botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ], nsfw: false, @@ -18,7 +18,7 @@ class ServersList extends Command { }); } - async run (message, args, data) { + async run (interaction, translate, data) { await message.delete(); @@ -27,17 +27,17 @@ class ServersList extends Command { let page = 1; let description = - `${message.translate("common:SERVERS")}: ${this.client.guilds.cache.size}\n\n`+ + `${translate("common:SERVERS")}: ${this.client.guilds.cache.size}\n\n`+ this.client.guilds.cache.sort((a,b) => b.memberCount-a.memberCount).map((r) => r) - .map((r, i) => `**${i + 1}** - ${r.name} | ${r.memberCount} ${message.translate("common:MEMBERS").toLowerCase()}`) + .map((r, i) => `**${i + 1}** - ${r.name} | ${r.memberCount} ${translate("common:MEMBERS").toLowerCase()}`) .slice(0, 10) .join("\n"); const embed = new Discord.MessageEmbed() - .setAuthor(message.author.tag, message.author.displayAvatarURL({ size: 512, dynamic: true, format: 'png' })) + .setAuthor(interaction.user.tag, interaction.user.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)}`) + .setTitle(`${translate("common:PAGE")}: ${page}/${Math.ceil(this.client.guilds.cache.size/10)}`) .setDescription(description); const msg = await message.channel.send({ embeds: [embed] }); @@ -46,7 +46,7 @@ class ServersList extends Command { await msg.react("➑"); await msg.react("❌"); - const collector = msg.createReactionCollector((reaction, user) => user.id === message.author.id); + const collector = msg.createReactionCollector((reaction, user) => user.id === interaction.user.id); collector.on("collect", async(reaction) => { @@ -65,14 +65,14 @@ class ServersList extends Command { return msg.delete(); } - description = `${message.translate("common:SERVERS")}: ${this.client.guilds.cache.size}\n\n`+ + description = `${translate("common:SERVERS")}: ${this.client.guilds.cache.size}\n\n`+ this.client.guilds.cache.sort((a,b) => b.memberCount-a.memberCount).map((r) => r) - .map((r, i) => `**${i + 1}** - ${r.name} | ${r.memberCount} ${message.translate("common:MEMBERS")}`) + .map((r, i) => `**${i + 1}** - ${r.name} | ${r.memberCount} ${translate("common:MEMBERS")}`) .slice(i0, i1) .join("\n"); // Update the embed with new informations - embed.setTitle(`${message.translate("common:PAGE")}: ${page}/${Math.round(this.client.guilds.cache.size/10)}`) + embed.setTitle(`${translate("common:PAGE")}: ${page}/${Math.round(this.client.guilds.cache.size/10)}`) .setDescription(description); // Edit the message @@ -95,14 +95,14 @@ class ServersList extends Command { return msg.delete(); } - description = `${message.translate("common:SERVERS")}: ${this.client.guilds.cache.size}\n\n`+ + description = `${translate("common:SERVERS")}: ${this.client.guilds.cache.size}\n\n`+ this.client.guilds.cache.sort((a,b) => b.memberCount-a.memberCount).map((r) => r) - .map((r, i) => `**${i + 1}** - ${r.name} | ${r.memberCount} ${message.translate("common:MEMBERS").toLowerCase()}`) + .map((r, i) => `**${i + 1}** - ${r.name} | ${r.memberCount} ${translate("common:MEMBERS").toLowerCase()}`) .slice(i0, i1) .join("\n"); // Update the embed with new informations - embed.setTitle(`${message.translate("common:PAGE")}: ${page}/${Math.round(this.client.guilds.cache.size/10)}`) + embed.setTitle(`${translate("common:PAGE")}: ${page}/${Math.round(this.client.guilds.cache.size/10)}`) .setDescription(description); // Edit the message @@ -115,11 +115,9 @@ class ServersList extends Command { } // Remove the reaction when the user react to the message - await reaction.users.remove(message.author.id); + await reaction.users.remove(interaction.user.id); }); } -} - -module.exports = ServersList; +}; diff --git a/config.sample.js b/config.sample.js index 1e8b2040b4..f25938445c 100644 --- a/config.sample.js +++ b/config.sample.js @@ -18,11 +18,6 @@ module.exports = { }, mongoDB: "mongodb://localhost:27017/AtlantaBot", // The URl of the mongodb database prefix: "*", // The default prefix for the bot - /* For the embeds (embeded messages) */ - embed: { - color: "#0091fc", // The default color for the embeds - footer: "Atlanta | Open Source" // And the default footer for the embeds - }, /* Bot's owner informations */ owner: { id: "XXXXXXXXXXX", // The ID of the bot's owner @@ -49,11 +44,6 @@ module.exports = { // SENTRY: https://sentry.io (this is not required and not recommended - you can delete the field) sentryDSN: "XXXXXXXXXXX" }, - /* The others utils links */ - others: { - github: "https://github.com/Androz2091", // Founder's github account - donate: "https://patreon.com/Androz2091" // Donate link - }, /* The Bot status */ status: [ { diff --git a/dashboard/routes/discord.js b/dashboard/routes/discord.js index 8c8979a02e..c52e0c6ec1 100644 --- a/dashboard/routes/discord.js +++ b/dashboard/routes/discord.js @@ -87,4 +87,4 @@ router.get("/callback", async (req, res) => { res.redirect(redirectURL); }); -module.exports = router; \ No newline at end of file +module.exports = router; diff --git a/dashboard/routes/guild-manager.js b/dashboard/routes/guild-manager.js index 5e7f018ae1..0a07394b73 100644 --- a/dashboard/routes/guild-manager.js +++ b/dashboard/routes/guild-manager.js @@ -146,4 +146,4 @@ router.post("/:serverID", CheckAuth, async(req, res) => { res.redirect(303, "/manage/"+guild.id); }); -module.exports = router; \ No newline at end of file +module.exports = router; diff --git a/dashboard/routes/guild-stats.js b/dashboard/routes/guild-stats.js index 86aca91bbe..04ed708f1c 100644 --- a/dashboard/routes/guild-stats.js +++ b/dashboard/routes/guild-stats.js @@ -107,4 +107,4 @@ function formatDate(date){ if(mm<10) {mm="0"+mm;} date = mm+"/"+dd; return date; -} \ No newline at end of file +} diff --git a/dashboard/routes/index.js b/dashboard/routes/index.js index a69a610c5e..07dd672f89 100644 --- a/dashboard/routes/index.js +++ b/dashboard/routes/index.js @@ -14,4 +14,4 @@ router.get("/selector", CheckAuth, async(req, res) => { }); }); -module.exports = router; \ No newline at end of file +module.exports = router; diff --git a/dashboard/routes/logout.js b/dashboard/routes/logout.js index 17d1e5f6ab..a3195d3492 100644 --- a/dashboard/routes/logout.js +++ b/dashboard/routes/logout.js @@ -7,4 +7,4 @@ router.get("/", async function(req, res) { res.redirect(req.client.config.dashboard.failureURL); }); -module.exports = router; \ No newline at end of file +module.exports = router; diff --git a/dashboard/routes/settings.js b/dashboard/routes/settings.js index 844292eec9..dae9ee20bb 100644 --- a/dashboard/routes/settings.js +++ b/dashboard/routes/settings.js @@ -48,4 +48,4 @@ function checkDate(birthdate){ if(d.getTime() > Date.now()) return false; if(d.getTime() < (Date.now()-2.523e+12)) return false; return d; -} \ No newline at end of file +} diff --git a/dashboard/utils.js b/dashboard/utils.js index b57a5c9a91..db4b09399a 100644 --- a/dashboard/utils.js +++ b/dashboard/utils.js @@ -42,4 +42,4 @@ async function fetchUser(userData, client, query){ return userInfos; } -module.exports = { fetchUser, fetchGuild }; \ No newline at end of file +module.exports = { fetchUser, fetchGuild }; diff --git a/docs/commands.md b/docs/commands.md index 842e04a2ce..375b81c0cd 100644 --- a/docs/commands.md +++ b/docs/commands.md @@ -7,167 +7,164 @@ Here's the list of Atlanta commands. This one contains more than **120 commands* **Usage**: The arguments/options that the command takes in parameters **Cooldown**: The time that must elapse between each command so that it can be executed again by the user -### Images (28 commands) - -| Name | Description | Usage | Cooldown | -| ------------------- | ------------------------------------------------------- | ----------------------------------- | --------- | -| **approved** | Generates a "approved" image | approved (@member) | 5 seconds | -| **avatar** | Shows the avatar of the mentionned member | avatar (@member) | 5 seconds | -| **batslap** | Generates a "batslap" image | batslap (@member1) (@member2) | 5 seconds | -| **beautiful** | Generates a "beautiful" image | beautiful (@member) | 5 seconds | -| **bed** | Generates a "love" image using the Nekobot API | love [@member1] (@member2) | 5 seconds | -| **brazzers** | Generates a "dictator" image | dictator (@member) | 5 seconds | -| **burn** | Generates a "brazzers" image | brazzers (@member) | 5 seconds | -| **captcha** | Generates a "captcha" image using the Nekobot API | captcha (@member) | 5 seconds | -| **challenger** | Generates a "challenger" image | challenger (@member) | 5 seconds | -| **clyde** | Generates a "Clyde" message image using the Nekobot API | clyde [text] | 5 seconds | -| **dictator** | Generates a "burn" image | burn (@member) | 5 seconds | -| **facepalm** | Generates a "facepalm" image using canvas | facepalm (@member) | 5 seconds | -| **fire** | Generates a "fire" image using Amethyste API | fire (@member) | 5 seconds | -| **jail** | Generates a "jail" image using Amethyste API | jail (@member) | 5 seconds | -| **kiss** | DESCRIPTION | USAGE | 5 seconds | -| **love** | Generates a "bed" image | bed [@member1] (@member2) | 5 seconds | -| **mission** | Generates a "mission" image using Amethyste API | mission (@member) | 5 seconds | -| **phcomment** | Generates a "phcomment" image | phcomment (@member) [text] | 5 seconds | -| **qrcode** | Generates a QR code image from a given text | qrcode [text] | 3 seconds | -| **rip** | Generates a "rip" image using Nekobot API | rip (@member) | 5 seconds | -| **scary** | Generates a "scary" image using Nekobot API | scary (@member) | 5 seconds | -| **tobecontinued** | Generates a "tobecontinued" image using Nekobot API | tobecontinued (@member) | 5 seconds | -| **trash** | Generates a "trash" image | trash (@member) | 5 seconds | -| **triggered** | Generates a "triggered" image using Nekobot API | triggered (@member) | 5 seconds | -| **tweet** | Generates a "tweet" image using Nekobot API | tweet [@twitter_username] [content] | 5 seconds | -| **wanted** | Generates a "wanted" image using Nekobot API | wanted (@member) | 5 seconds | -| **wasted** | Generates a "wasted" image using Nekobot API | wasted (@member) | 5 seconds | -| **youtube-comment** | Generates a "youtube-comment" image | youtube-comment (@member) [text] | 5 seconds | +### Images (27 commands) + +| Name | Description | Usage | Cooldown | +| ------------------- | ------------------------------------------------------- | ----------------------------------- | ----------- | +| **approved** | Generates a "approved" image | approved (@member) | NaN seconds | +| **avatar** | Shows the avatar of the mentionned member | avatar (@member) | NaN seconds | +| **batslap** | Generates a "batslap" image | batslap (@member1) (@member2) | NaN seconds | +| **beautiful** | Generates a "beautiful" image | beautiful (@member) | NaN seconds | +| **bed** | Generates a "love" image using the Nekobot API | love [@member1] (@member2) | NaN seconds | +| **brazzers** | Generates a "dictator" image | dictator (@member) | NaN seconds | +| **burn** | Generates a "brazzers" image | brazzers (@member) | NaN seconds | +| **captcha** | Generates a "captcha" image using the Nekobot API | captcha (@member) | NaN seconds | +| **challenger** | Generates a "challenger" image | challenger (@member) | NaN seconds | +| **clyde** | Generates a "Clyde" message image using the Nekobot API | clyde [text] | NaN seconds | +| **dictator** | Generates a "burn" image | burn (@member) | NaN seconds | +| **facepalm** | Generates a "facepalm" image using canvas | facepalm (@member) | NaN seconds | +| **fire** | Generates a "fire" image using Amethyste API | fire (@member) | NaN seconds | +| **jail** | Generates a "jail" image using Amethyste API | jail (@member) | NaN seconds | +| **love** | Generates a "bed" image | bed [@member1] (@member2) | NaN seconds | +| **mission** | Generates a "mission" image using Amethyste API | mission (@member) | NaN seconds | +| **phcomment** | Generates a "phcomment" image | phcomment (@member) [text] | NaN seconds | +| **qrcode** | Generates a QR code image from a given text | qrcode [text] | NaN seconds | +| **rip** | Generates a "rip" image using Nekobot API | rip (@member) | NaN seconds | +| **scary** | Generates a "scary" image using Nekobot API | scary (@member) | NaN seconds | +| **tobecontinued** | Generates a "tobecontinued" image using Nekobot API | tobecontinued (@member) | NaN seconds | +| **trash** | Generates a "trash" image | trash (@member) | NaN seconds | +| **triggered** | Generates a "triggered" image using Nekobot API | triggered (@member) | NaN seconds | +| **tweet** | Generates a "tweet" image using Nekobot API | tweet [@twitter_username] [content] | NaN seconds | +| **wanted** | Generates a "wanted" image using Nekobot API | wanted (@member) | NaN seconds | +| **wasted** | Generates a "wasted" image using Nekobot API | wasted (@member) | NaN seconds | +| **youtube-comment** | Generates a "youtube-comment" image | youtube-comment (@member) [text] | NaN seconds | ### General (22 commands) -| Name | Description | Usage | Cooldown | -| ---------------- | ----------------------------------------------------------- | ------------------------------ | --------- | -| **fortnite** | Shows a player's Fortnite stats! | fortnite [psn/xbl/pc] [pseudo] | 1 seconds | -| **fortniteshop** | Shows the daily fortnite items shop! | fortniteshop | 1 seconds | -| **github** | Shows Atlanta's Github repository information! | github | 5 seconds | -| **hastebin** | Upload your text on hastebin! | hastebin [text] | 5 seconds | -| **help** | Show commands list or specific command help. | help (command) | 5 seconds | -| **invitations** | Shows the number of people you have invited to the server! | invitations (@member) | 3 seconds | -| **invite** | Shows Atlanta links! | invite (copy) | 5 seconds | -| **minecraft** | Shows information about a Minecraft server! | minecraft [ip] | 3 seconds | -| **permissions** | Displays the member's permissions in the channel | permissions (@member) | 1 seconds | -| **ping** | Show bot's ping | ping | 1 seconds | -| **quote** | Quote a message in the channel! | quote [messageID] [channel] | 5 seconds | -| **remindme** | Add a new personal reminder | remindme [message] | 3 seconds | -| **report** | Send your report to the channel defined for them! | report [@user] [reason] | 5 seconds | -| **serverinfo** | Shows information about the server! | serverinfo [ID/Name] | 3 seconds | -| **setafk** | Become AFK (members who mention you will receive a message) | setafk [reason] | 3 seconds | -| **shorturl** | Make your links shorter! | shorturl [url] | 5 seconds | -| **someone** | Pick a random member on the server! | someone | 1 seconds | -| **staff** | Shows the server staff members list! | staff | 3 seconds | -| **stats** | Shows the bot stats! | stats | 3 seconds | -| **suggest** | Send your suggestion to the defined channel! | suggest [message] | 5 seconds | -| **translate** | Translate your text! | translate [language] [message] | 8 seconds | -| **userinfo** | Shows user information! | userinfo (@user/userID) | 5 seconds | +| Name | Description | Usage | Cooldown | +| ---------------- | ----------------------------------------------------------- | ------------------------------ | ----------- | +| **fortnite** | Shows a player's Fortnite stats! | fortnite [psn/xbl/pc] [pseudo] | NaN seconds | +| **fortniteshop** | Shows the daily fortnite items shop! | fortniteshop | NaN seconds | +| **github** | Shows Atlanta's Github repository information! | github | NaN seconds | +| **hastebin** | Upload your text on hastebin! | hastebin [text] | NaN seconds | +| **help** | Show commands list or specific command help. | help (command) | NaN seconds | +| **invitations** | Shows the number of people you have invited to the server! | invitations (@member) | NaN seconds | +| **invite** | Shows Atlanta links! | invite (copy) | NaN seconds | +| **minecraft** | Shows information about a Minecraft server! | minecraft [ip] | NaN seconds | +| **permissions** | Displays the member's permissions in the channel | permissions (@member) | NaN seconds | +| **ping** | Show bot's ping | ping | NaN seconds | +| **quote** | Quote a message in the channel! | quote [messageID] [channel] | NaN seconds | +| **remindme** | Add a new personal reminder | remindme [message] | NaN seconds | +| **report** | Send your report to the channel defined for them! | report [@user] [reason] | NaN seconds | +| **serverinfo** | Shows information about the server! | serverinfo [ID/Name] | NaN seconds | +| **setafk** | Become AFK (members who mention you will receive a message) | setafk [reason] | NaN seconds | +| **shorturl** | Make your links shorter! | shorturl [url] | NaN seconds | +| **someone** | Pick a random member on the server! | someone | NaN seconds | +| **staff** | Shows the server staff members list! | staff | NaN seconds | +| **stats** | Shows the bot stats! | stats | NaN seconds | +| **suggest** | Send your suggestion to the defined channel! | suggest [message] | NaN seconds | +| **translate** | Translate your text! | translate [language] [message] | NaN seconds | +| **userinfo** | Shows user information! | userinfo (@user/userID) | NaN seconds | ### Administration (18 commands) -| Name | Description | Usage | Cooldown | -| ------------------- | ----------------------------------------------- | -------------------------------- | ---------- | -| **addcommand** | Add a custom command! | addcommand [name] [answer] | 3 seconds | -| **addemoji** | Add an emoji to the server! | addemoji [image-url] [name] | 5 seconds | -| **automod** | Toggle Discord invites automatic deletion | automod [on/off] (#channel) | 5 seconds | -| **autorole** | Toggle autorole on the server! | autorole [on/off] (role) | 5 seconds | -| **backup** | Manage your server backups in an efficient way! | backup [create/load/infos] | 30 seconds | -| **configuration** | Shows the server configuration! | configuration | 3 seconds | -| **delcommand** | Remove a custom command! | delcommand [name-of-the-command] | 3 seconds | -| **deletemod** | Toggle moderation commands auto deletion! | deletemod [on/off] | 3 seconds | -| **goodbye** | Toggle goodbye messages! | goodbye | 3 seconds | -| **ignore** | Toggle commands in a channel | ignore [channel] | 3 seconds | -| **setfortniteshop** | Set the daily Fortnite shop channel! | setfortniteshop (#channel) | 5 seconds | -| **setlang** | Change the server language! | setlang [language] | 3 seconds | -| **setmodlogs** | Set the moderation logs channel! | setmodlogs (#channel) | 3 seconds | -| **setprefix** | Set the server prefix! | setprefix [prefix] | 3 seconds | -| **setreports** | Set the reports channel! | setreports (#channel) | 3 seconds | -| **setsuggests** | Set the suggestions channel! | setsuggests (#channel) | 3 seconds | -| **slowmode** | Set a channel cooldown | slowmode [#channel] (time) | 3 seconds | -| **welcome** | Toggle welcome messages! | welcome | 3 seconds | +| Name | Description | Usage | Cooldown | +| ------------------- | ----------------------------------------------- | -------------------------------- | ----------- | +| **addcommand** | Add a custom command! | addcommand [name] [answer] | NaN seconds | +| **addemoji** | Add an emoji to the server! | addemoji [image-url] [name] | NaN seconds | +| **automod** | Toggle Discord invites automatic deletion | automod [on/off] (#channel) | NaN seconds | +| **autorole** | Toggle autorole on the server! | autorole [on/off] (role) | NaN seconds | +| **backup** | Manage your server backups in an efficient way! | backup [create/load/infos] | NaN seconds | +| **configuration** | Shows the server configuration! | configuration | NaN seconds | +| **delcommand** | Remove a custom command! | delcommand [name-of-the-command] | NaN seconds | +| **deletemod** | Toggle moderation commands auto deletion! | deletemod [on/off] | NaN seconds | +| **goodbye** | Toggle goodbye messages! | goodbye | NaN seconds | +| **ignore** | Toggle commands in a channel | ignore [channel] | NaN seconds | +| **setfortniteshop** | Set the daily Fortnite shop channel! | setfortniteshop (#channel) | NaN seconds | +| **setlang** | Change the server language! | setlang [language] | NaN seconds | +| **setmodlogs** | Set the moderation logs channel! | setmodlogs (#channel) | NaN seconds | +| **setprefix** | Set the server prefix! | setprefix [prefix] | NaN seconds | +| **setreports** | Set the reports channel! | setreports (#channel) | NaN seconds | +| **setsuggests** | Set the suggestions channel! | setsuggests (#channel) | NaN seconds | +| **slowmode** | Set a channel cooldown | slowmode [#channel] (time) | NaN seconds | +| **welcome** | Toggle welcome messages! | welcome | NaN seconds | ### Economy (15 commands) -| Name | Description | Usage | Cooldown | -| ---------------- | ------------------------------------------------------------------- | -------------------------------- | ---------- | -| **achievements** | Shows your achievements list! | achievements | 1 seconds | -| **birthdate** | Set the birthday date that appear on your profile | birthdate (date) | 1 seconds | -| **deposit** | Deposit your money in the bank | deposit [amount] | 1 seconds | -| **divorce** | Divorce the person you are currently married to! | divorce | 3 seconds | -| **leaderboard** | Shows users who have the most credits, levels or reputation points! | leaderboard [rep/levels/credits] | 5 seconds | -| **marry** | Marry someone you love! | marry [@member] | 10 seconds | -| **money** | Shows your credits | money (@member) | 1 seconds | -| **pay** | Send money to someone! | pay [@member] [amount] | 10 seconds | -| **profile** | Shows the mentioned user or author profile | profile [user] | 3 seconds | -| **rep** | Give a reputation point to someone! | rep [user] | 3 seconds | -| **rob** | Try to rob a member! | rob [@member] [amount] | 1 seconds | -| **setbio** | Change your biography! | setbio [biography] | 5 seconds | -| **slots** | The Atlanta casino | slots [amount] | 3 seconds | -| **withdraw** | Withdraw money! | withdraw [amount] | 1 seconds | -| **work** | Claim your salary! | work | 3 seconds | +| Name | Description | Usage | Cooldown | +| ---------------- | ------------------------------------------------------------------- | -------------------------------- | ----------- | +| **achievements** | Shows your achievements list! | achievements | NaN seconds | +| **birthdate** | Set the birthday date that appear on your profile | USAGE | NaN seconds | +| **deposit** | Deposit your money in the bank | deposit [amount] | NaN seconds | +| **divorce** | Divorce the person you are currently married to! | divorce | NaN seconds | +| **leaderboard** | Shows users who have the most credits, levels or reputation points! | leaderboard [rep/levels/credits] | NaN seconds | +| **marry** | Marry someone you love! | marry [@member] | NaN seconds | +| **money** | Shows your credits | money (@member) | NaN seconds | +| **pay** | Send money to someone! | pay [@member] [amount] | NaN seconds | +| **profile** | Shows the mentioned user or author profile | profile [user] | NaN seconds | +| **rep** | Give a reputation point to someone! | rep [user] | NaN seconds | +| **rob** | Try to rob a member! | rob [@member] [amount] | NaN seconds | +| **setbio** | Change your biography! | setbio [biography] | NaN seconds | +| **slots** | The Atlanta casino | slots [amount] | NaN seconds | +| **withdraw** | Withdraw money! | withdraw [amount] | NaN seconds | +| **work** | Claim your salary! | work | NaN seconds | ### Moderation (14 commands) -| Name | Description | Usage | Cooldown | -| ------------------- | --------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ | --------- | -| **announcement** | Send an announcement in the current channel! | announcement [text] | 3 seconds | -| **ban** | Ban the mentioned member! | ban [@user] (reason) | 3 seconds | -| **checkinvites** | Check if members have a Discord server link in their status! | checkinvites | 3 seconds | -| **clear** | Quickly delete multiple messages! | clear [number-of-messages] (@member) | 3 seconds | -| **clear-sanctions** | Clear a member sanctions! | clear-sanctions [@member] | 3 seconds | -| **giveaway** | Easily manage your giveaways! | giveaway [create/reroll/delete/end] (time) (winners count) (prize) | 5 seconds | -| **kick** | Kick the mentioned member! | kick [@member] (reason) | 3 seconds | -| **mute** | Prevents a member from sending messages and connecting to a voice chat room for a defined period of time! | mute [@member] [time] | 3 seconds | -| **poll** | Launch a survey in the current channel! | poll [question] | 3 seconds | -| **sanctions** | Displays the list of infractions committed by a member! | sanctions [@member] | 3 seconds | -| **setwarns** | Define the sanctions that members will get after a certain number of warns! | setwarns [kick/ban] [number/reset] | 3 seconds | -| **unban** | Unban the user from the server! | unban [userID/user#0000] | 3 seconds | -| **unmute** | Unmute the mentioned member! | unmute [@member] | 3 seconds | -| **warn** | Warn a member in private messages | warn [@member] [reason] | 3 seconds | - -### Music (13 commands) - -| Name | Description | Usage | Cooldown | -| ------------ | ---------------------------------------------------------------------- | ------------------ | --------- | -| **autoplay** | Enable or disable the autoplay feature | autoplay | 5 seconds | -| **back** | Play back the previous song | back | 5 seconds | -| **filter** | Enable or disable a filter! | filter [filter] | 5 seconds | -| **filters** | Send the list of all the filters and their status | filters | 5 seconds | -| **lyrics** | Shows the song lyrics | lyrics [song-name] | 5 seconds | -| **np** | Shows information about the current song! | np | 5 seconds | -| **pause** | Pause the current song! | pause | 5 seconds | -| **play** | Plays music for you! | play [song] | 5 seconds | -| **queue** | Shows the server queue | queue | 5 seconds | -| **resume** | Resume the current song! | resume | 5 seconds | -| **seek** | Go forward or backward a specific amount of time in the current song!! | seek [time] | 5 seconds | -| **skip** | Skip the current song | skip | 5 seconds | -| **stop** | Stop the music | stop | 5 seconds | - -### Fun (10 commands) - -| Name | Description | Usage | Cooldown | -| ------------- | --------------------------------------------------------------------------------------------- | ------------------------------- | --------- | -| **8ball** | I'm telling you the truth! | 8ball [question] | 3 seconds | -| **ascii** | Turn your text into ascii characters! | ascii [text] | 5 seconds | -| **choice** | Helps you choose between the given choices! | choice [choice1/choice2/etc...] | 5 seconds | -| **findwords** | Start a Findwords party, a game where you have to find words! | findwords | 5 seconds | -| **flip** | I roll the dice for you! | flip | 1 seconds | -| **fml** | Gets a random FML | fml | 3 seconds | -| **joke** | Gets a wonderful joke specially made for you! | joke | 3 seconds | -| **lmg** | Generate a LMGTFY link with your search | lmg [search] | 1 seconds | +| Name | Description | Usage | Cooldown | +| ------------------- | --------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ | ----------- | +| **announcement** | Send an announcement in the current channel! | announcement [text] | NaN seconds | +| **ban** | Ban the mentioned member! | ban [@user] (reason) | NaN seconds | +| **checkinvites** | Check if members have a Discord server link in their status! | checkinvites | NaN seconds | +| **clear** | Quickly delete multiple messages! | clear [number-of-messages] (@member) | NaN seconds | +| **clear-sanctions** | Clear a member sanctions! | clear-sanctions [@member] | NaN seconds | +| **giveaway** | Easily manage your giveaways! | giveaway [create/reroll/delete/end] (time) (winners count) (prize) | NaN seconds | +| **kick** | Kick the mentioned member! | kick [@member] (reason) | NaN seconds | +| **mute** | Prevents a member from sending messages and connecting to a voice chat room for a defined period of time! | mute [@member] [time] | NaN seconds | +| **poll** | Launch a survey in the current channel! | poll [question] | NaN seconds | +| **sanctions** | Displays the list of infractions committed by a member! | sanctions [@member] | NaN seconds | +| **setwarns** | Define the sanctions that members will get after a certain number of warns! | setwarns [kick/ban] [number/reset] | NaN seconds | +| **unban** | Unban the user from the server! | unban [userID/user#0000] | NaN seconds | +| **unmute** | Unmute the mentioned member! | unmute [@member] | NaN seconds | +| **warn** | Warn a member in private messages | warn [@member] [reason] | NaN seconds | + +### Music (12 commands) + +| Name | Description | Usage | Cooldown | +| ------------ | ---------------------------------------------------------------------- | ------------------ | ----------- | +| **autoplay** | Enable or disable the autoplay feature | autoplay | NaN seconds | +| **back** | Play back the previous song | back | NaN seconds | +| **filters** | Send the list of all the filters and their status | filters | NaN seconds | +| **lyrics** | Shows the song lyrics | lyrics [song-name] | NaN seconds | +| **np** | Shows information about the current song! | np | NaN seconds | +| **pause** | Pause the current song! | pause | NaN seconds | +| **play** | Plays music for you! | play [song] | NaN seconds | +| **queue** | Shows the server queue | queue | NaN seconds | +| **resume** | Resume the current song! | resume | NaN seconds | +| **seek** | Go forward or backward a specific amount of time in the current song!! | seek [time] | NaN seconds | +| **skip** | Skip the current song | skip | NaN seconds | +| **stop** | Stop the music | stop | NaN seconds | + +### Fun (9 commands) + +| Name | Description | Usage | Cooldown | +| ------------- | --------------------------------------------------------------------------------------------- | ------------------------------- | ----------- | +| **8ball** | I'm telling you the truth! | 8ball [question] | NaN seconds | +| **ascii** | Turn your text into ascii characters! | ascii [text] | NaN seconds | +| **choice** | Helps you choose between the given choices! | choice [choice1/choice2/etc...] | NaN seconds | +| **findwords** | Start a Findwords party, a game where you have to find words! | findwords | NaN seconds | +| **fml** | Gets a random FML | fml | NaN seconds | +| **joke** | Gets a wonderful joke specially made for you! | joke | NaN seconds | +| **lmg** | Generate a LMGTFY link with your search | lmg [search] | NaN seconds | | **lovecalc** | How much love is there between two people? -*This is a fun command, not to be taken seriously* | lovecalc [@member1] (@member2) | 1 seconds | -| **number** | Find the right number! | number | 5 seconds | +*This is a fun command, not to be taken seriously* | lovecalc [@member1] (@member2) | NaN seconds | +| **number** | Find the right number! | number | NaN seconds | ### Owner (3 commands) -| Name | Description | Usage | Cooldown | -| ---------------- | ----------------------- | ------------ | --------- | -| **eval** | Executes the given code | eval [code] | 3 seconds | -| **reload** | Reload a command! | reload | 3 seconds | -| **servers-list** | Show the servers list! | servers-list | 5 seconds | +| Name | Description | Usage | Cooldown | +| ---------------- | ----------------------- | ------------ | ----------- | +| **eval** | Executes the given code | eval [code] | NaN seconds | +| **reload** | Reload a command! | reload | NaN seconds | +| **servers-list** | Show the servers list! | servers-list | NaN seconds | diff --git a/events/guildCreate.js b/events/guildCreate.js index 15c703dd2b..16b7bbea4a 100644 --- a/events/guildCreate.js +++ b/events/guildCreate.js @@ -48,4 +48,4 @@ module.exports = class { this.client.channels.cache.get(this.client.config.support.logs).send(logsEmbed); } -}; \ No newline at end of file +}; diff --git a/events/guildDelete.js b/events/guildDelete.js index 0f81d2d651..e0394234d1 100644 --- a/events/guildDelete.js +++ b/events/guildDelete.js @@ -18,4 +18,4 @@ module.exports = class { this.client.channels.cache.get(this.client.config.support.logs).send({ embeds: [embed] }); } -}; \ No newline at end of file +}; diff --git a/events/guildMemberAdd.js b/events/guildMemberAdd.js index dbdb2034c9..d3d5a378e8 100644 --- a/events/guildMemberAdd.js +++ b/events/guildMemberAdd.js @@ -138,4 +138,4 @@ module.exports = class { } -}; \ No newline at end of file +}; diff --git a/events/guildMemberRemove.js b/events/guildMemberRemove.js index 6a16c70ef3..23f765cbc9 100644 --- a/events/guildMemberRemove.js +++ b/events/guildMemberRemove.js @@ -121,4 +121,4 @@ module.exports = class { } } }; - \ No newline at end of file + diff --git a/events/guildMemberUpdate.js b/events/guildMemberUpdate.js index 6200fb4a00..245e14da03 100644 --- a/events/guildMemberUpdate.js +++ b/events/guildMemberUpdate.js @@ -16,4 +16,4 @@ module.exports = class { newMember.send({ files: [ { name: "unlocked.png", attachment: "./assets/img/achievements/achievement_unlocked5.png"} ] }); } } -}; \ No newline at end of file +}; diff --git a/events/interactionCreate.js b/events/interactionCreate.js new file mode 100644 index 0000000000..3054d1c8c8 --- /dev/null +++ b/events/interactionCreate.js @@ -0,0 +1,128 @@ +module.exports = class { + constructor (client) { + this.client = client; + } + + async run (interaction) { + + if (!interaction.isCommand()) return; + + let translate = this.client.translations.get("en-US"); + let guildData; + let memberData; + if(interaction.guild){ + // Gets guild data + guildData = await this.client.findOrCreateGuild({ id: interaction.guild.id }); + memberData = await this.client.findOrCreateMember({ id: interaction.user.id, guildID: interaction.guild.id }); + translate = this.client.translations.get(guildData.language); + } + + const userData = await this.client.findOrCreateUser({ id: interaction.user.id }); + + const command = this.client.commands.get(interaction.commandName); + if (!command) return; + + // TODO: add support for custom slash commands + + if(interaction.guild && guildData.ignoredChannels.includes(interaction.channel.id) && !interaction.member.permissions.has("MANAGE_MESSAGES")){ + interaction.reply({ + content: translate("misc:RESTRICTED_CHANNEL", { + channel: interaction.channel.toString() + }), + ephemeral: true + }); + return; + } + + if(command.conf.guildOnly && !interaction.guild){ + return interaction.reply({ + content: translate("misc:GUILD_ONLY"), + ephemeral: true + }); + } + + if(interaction.guild){ + let neededPermissions = []; + if(!command.conf.botPermissions.includes("EMBED_LINKS")){ + command.conf.botPermissions.push("EMBED_LINKS"); + } + command.conf.botPermissions.forEach((perm) => { + if(!interaction.channel.permissionsFor(interaction.guild.me).has(perm)){ + neededPermissions.push(perm); + } + }); + if(neededPermissions.length > 0){ + return interaction.reply({ + content: translate("misc:MISSING_BOT_PERMS", { + list: neededPermissions.map((p) => `\`${p}\``).join(", "), + }), + ephemeral: true + }); + } + neededPermissions = []; + command.conf.memberPermissions.forEach((perm) => { + if(!interaction.channel.permissionsFor(interaction.member).has(perm)){ + neededPermissions.push(perm); + } + }); + if(neededPermissions.length > 0){ + return interaction.reply({ + content: translate("misc:MISSING_MEMBER_PERMS", { + list: neededPermissions.map((p) => `\`${p}\``).join(", ") + }), + ephemeral: true + }); + } + if(!interaction.channel.nsfw && command.conf.nsfw){ + return interaction.reply({ + content: translate("misc:NSFW_COMMAND") + }); + } + } + + if(!command.conf.enabled){ + return interaction.reply({ + content: "misc:COMMAND_DISABLED", + ephemeral: true + }); + } + + if(command.conf.ownerOnly && interaction.user.id !== this.client.config.owner.id){ + return interaction.reply({ + content: translate("misc:OWNER_ONLY"), + ephemeral: true + }); + } + + this.client.logger.log(`${interaction.user.username} (${interaction.user.id}) ran slash command ${command.help.name}`, "cmd"); + + const log = new this.client.logs({ + commandName: command.help.name, + author: { username: interaction.user.username, discriminator: interaction.user.discriminator, id: interaction.user.id }, + guild: { name: interaction.guild ? interaction.guild.name : "dm", id: interaction.guild ? interaction.guild.id : "dm" } + }); + log.save(); + + if(!userData.achievements.firstCommand.achieved){ + userData.achievements.firstCommand.progress.now = 1; + userData.achievements.firstCommand.achieved = true; + userData.markModified("achievements.firstCommand"); + await userData.save(); + await interaction.channel.send({ files: [ + { + name: "unlocked.png", + attachment: "./assets/img/achievements/achievement_unlocked2.png" + } + ]}); + } + + try { + command.run(interaction, translate, { guildData, userData, memberData }); + } catch(e){ + console.error(e); + return interaction.reply({ + content: translate("misc:ERR_OCCURRED") + }); + } + } +}; diff --git a/events/message.js b/events/message.js index 3e209be010..9fbeb1a775 100644 --- a/events/message.js +++ b/events/message.js @@ -26,7 +26,7 @@ module.exports = class { if(message.guild){ // Gets guild data const guild = await client.findOrCreateGuild({ id: message.guild.id }); - message.guild.data = data.guild = guild; + message.guild.data = data.guildData = guild; } // Check if the bot was mentionned @@ -34,7 +34,7 @@ module.exports = class { if(message.guild){ return message.sendT("misc:HELLO_SERVER", { username: message.author.username, - prefix: data.guild.prefix + prefix: data.guildData.prefix }); } else { return message.sendT("misc:HELLO_DM", { @@ -61,9 +61,9 @@ module.exports = class { await updateXp(message, data); if(!message.channel.permissionsFor(message.member).has("MANAGE_MESSAGES") && !message.editedAt){ - const channelSlowmode = data.guild.slowmode.channels.find((ch) => ch.id === message.channel.id); + const channelSlowmode = data.guildData.slowmode.channels.find((ch) => ch.id === message.channel.id); if(channelSlowmode){ - const uSlowmode = data.guild.slowmode.users.find((d) => d.id === (message.author.id+message.channel.id)); + const uSlowmode = data.guildData.slowmode.users.find((d) => d.id === (message.author.id+message.channel.id)); if(uSlowmode){ if(uSlowmode.time > Date.now()){ message.delete(); @@ -76,17 +76,17 @@ module.exports = class { uSlowmode.time = channelSlowmode.time+Date.now(); } } else { - data.guild.slowmode.users.push({ + data.guildData.slowmode.users.push({ id: message.author.id+message.channel.id, time: channelSlowmode.time+Date.now() }); } - data.guild.markModified("slowmode.users"); - await data.guild.save(); + data.guildData.markModified("slowmode.users"); + await data.guildData.save(); } } - if(data.guild.plugins.automod.enabled && !data.guild.plugins.automod.ignored.includes(message.channel.id)){ + if(data.guildData.plugins.automod.enabled && !data.guildData.plugins.automod.ignored.includes(message.channel.id)){ if(/(discord\.(gg|io|me|li)\/.+|discordapp\.com\/invite\/.+)/i.test(message.content)){ if(!message.channel.permissionsFor(message.member).has("MANAGE_MESSAGES")){ message.delete(); @@ -129,7 +129,7 @@ module.exports = class { const command = args.shift().toLowerCase(); const cmd = client.commands.get(command) || client.commands.get(client.aliases.get(command)); - const customCommand = message.guild ? data.guild.customCommands.find((c) => c.name === command) : null; + const customCommand = message.guild ? data.guildData.customCommands.find((c) => c.name === command) : null; const customCommandAnswer = customCommand ? customCommand.answer : ""; if(!cmd && !customCommandAnswer && message.guild) return; @@ -139,7 +139,7 @@ module.exports = class { }); } - if(message.guild && data.guild.ignoredChannels.includes(message.channel.id) && !message.member.permissions.has("MANAGE_MESSAGES")){ + if(message.guild && data.guildData.ignoredChannels.includes(message.channel.id) && !message.member.permissions.has("MANAGE_MESSAGES")){ message.delete(); message.author.send(message.translate("misc:RESTRICTED_CHANNEL", { channel: message.channel.toString() @@ -234,7 +234,7 @@ module.exports = class { try { cmd.run(message, args, data); - if(cmd.help.category === "Moderation" && data.guild.autoDeleteModCommands){ + if(cmd.help.category === "Moderation" && data.guildData.autoDeleteModCommands){ message.delete(); } } catch(e){ diff --git a/events/ready.js b/events/ready.js index b51752b809..5a0e69cfe1 100644 --- a/events/ready.js +++ b/events/ready.js @@ -53,4 +53,4 @@ module.exports = class { }, 400); } -}; \ No newline at end of file +}; diff --git a/helpers/autoUpdateDocs.js b/helpers/autoUpdateDocs.js index 35b017afd6..830e038d00 100644 --- a/helpers/autoUpdateDocs.js +++ b/helpers/autoUpdateDocs.js @@ -18,8 +18,8 @@ module.exports = { let text = `# Commands \nHere's the list of Atlanta commands. This one contains more than **${Math.floor(commands.size/10)}0 commands** in **${categories.length} categories**! \n\n#### Contents of the table \n**Name**: The name of the command \n**Description**: A brief explanation of the purpose of the command \n**Usage**: The arguments/options that the command takes in parameters \n**Cooldown**: The time that must elapse between each command so that it can be executed again by the user\n\n`; categories.sort(function(a, b){ - const aCmdsLength = commands.filter((cmd) => cmd.help.category === a).array().length; - const bCmdsLength = commands.filter((cmd) => cmd.help.category === b).array().length; + const aCmdsLength = commands.filter((cmd) => cmd.help.category === a).toJSON().length; + const bCmdsLength = commands.filter((cmd) => cmd.help.category === b).toJSON().length; if(aCmdsLength > bCmdsLength){ return -1; } else { @@ -29,7 +29,7 @@ module.exports = { const arrCat = [ [ "Name", "Description", "Usage", "Cooldown" ] ]; - const cmds = commands.filter((cmd) => cmd.help.category === cat).array(); + const cmds = commands.filter((cmd) => cmd.help.category === cat).toJSON(); text += `### ${cat} (${cmds.length} commands)\n\n`; cmds.sort(function(a, b){ if(a.help.name < b.help.name) { @@ -54,4 +54,4 @@ module.exports = { } } -}; \ No newline at end of file +}; diff --git a/helpers/checkReminds.js b/helpers/checkReminds.js index 707507f231..7bbb5792fe 100644 --- a/helpers/checkReminds.js +++ b/helpers/checkReminds.js @@ -44,4 +44,4 @@ module.exports = { }, 1000); } -}; \ No newline at end of file +}; diff --git a/helpers/checkUnmutes.js b/helpers/checkUnmutes.js index 95efe4849b..0cec275fee 100644 --- a/helpers/checkUnmutes.js +++ b/helpers/checkUnmutes.js @@ -15,7 +15,7 @@ module.exports = { }); }); setInterval(async () => { - client.databaseCache.mutedUsers.array().filter((m) => m.mute.endDate <= Date.now()).forEach(async (memberData) => { + client.databaseCache.mutedUsers.toJSON().filter((m) => m.mute.endDate <= Date.now()).forEach(async (memberData) => { const guild = client.guilds.cache.get(memberData.guildID); if(!guild) return; const member = guild.members.cache.get(memberData.id) || await guild.members.fetch(memberData.id).catch(() => { diff --git a/helpers/constants.js b/helpers/constants.js new file mode 100644 index 0000000000..9fa49ce0ff --- /dev/null +++ b/helpers/constants.js @@ -0,0 +1,11 @@ +module.exports = { + Embed: { + COLOR: "#0091fc", // The default color for the embeds + FOOTER: "Atlanta | Open Source" // And the default footer for the embeds + }, + /* The others utils links */ + Links: { + GITHUB: "https://github.com/Androz2091", // Founder's github account + DONATE: "https://patreon.com/Androz2091" // Donate link + } +}; diff --git a/helpers/discordbots.org.js b/helpers/discordbots.org.js index 1dff129b09..139e425a52 100644 --- a/helpers/discordbots.org.js +++ b/helpers/discordbots.org.js @@ -33,4 +33,4 @@ module.exports = { } } -}; \ No newline at end of file +}; diff --git a/helpers/extenders.js b/helpers/extenders.js index 72895824bd..e69de29bb2 100644 --- a/helpers/extenders.js +++ b/helpers/extenders.js @@ -1,66 +0,0 @@ -const { Guild, Message, MessageEmbed } = require("discord.js"); -const config = require("../config"); - -Guild.prototype.translate = function(key, args) { - const language = this.client.translations.get(this.data.language); - if (!language) throw "Message: Invalid language set in data."; - return language(key, args); -}; - -Message.prototype.translate = function(key, args) { - const language = this.client.translations.get( - this.guild ? this.guild.data.language : "en-US" - ); - if (!language) throw "Message: Invalid language set in data."; - return language(key, args); -}; - -// Wrapper for sendT with error emoji -Message.prototype.error = function(key, args, options = {}) { - options.prefixEmoji = "error"; - return this.sendT(key, args, options); -}; - -// Wrapper for sendT with success emoji -Message.prototype.success = function(key, args, options = {}) { - options.prefixEmoji = "success"; - return this.sendT(key, args, options); -}; - -// Translate and send the message -Message.prototype.sendT = function(key, args, options = {}) { - let string = this.translate(key, args); - if (options.prefixEmoji) { - string = `${this.client.customEmojis[options.prefixEmoji]} | ${string}`; - } - if (options.edit) { - return this.edit(string); - } else { - return this.channel.send(string); - } -}; - -// Format a date -Message.prototype.printDate = function(date, format) { - return this.client.printDate(date, format, this.guild.data.language); -}; - -// Convert time -Message.prototype.convertTime = function(time, type, noPrefix) { - return this.client.convertTime(time, type, noPrefix, (this.guild && this.guild.data) ? this.guild.data.language : null); -}; - -MessageEmbed.prototype.errorColor = function() { - this.setColor("#FF0000"); - return this; -}; - -MessageEmbed.prototype.successColor = function() { - this.setColor("#32CD32"); - return this; -}; - -MessageEmbed.prototype.defaultColor = function() { - this.setColor(config.color); - return this; -}; diff --git a/helpers/functions.js b/helpers/functions.js index 1db515e50b..f5dbd08a87 100644 --- a/helpers/functions.js +++ b/helpers/functions.js @@ -16,7 +16,7 @@ module.exports = { `<@!${message.client.user.id}> `, `<@${message.client.user.id}> `, message.client.user.username.toLowerCase(), - data.guild.prefix + data.guildData.prefix ]; let prefix = null; prefixes.forEach((p) => { @@ -111,4 +111,4 @@ module.exports = { return absoluteTime.join(", "); } -}; \ No newline at end of file +}; diff --git a/helpers/logger.js b/helpers/logger.js index da9345df2b..fb518fb5fd 100644 --- a/helpers/logger.js +++ b/helpers/logger.js @@ -47,4 +47,4 @@ module.exports = class Logger { default: throw new TypeError("Logger type must be either warn, debug, log, ready, cmd or error."); } } -}; \ No newline at end of file +}; diff --git a/languages/en-US/administration/addcommand.json b/languages/en-US/administration/addcommand.json index 2754d00db0..041e599141 100644 --- a/languages/en-US/administration/addcommand.json +++ b/languages/en-US/administration/addcommand.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Add a custom command!", - "USAGE": "{{prefix}}addcommand [name] [answer]", "EXAMPLES": "{{prefix}}addcommand hello Hello {user}! How are you?", "MISSING_NAME": "Please provide a command name!", "MISSING_ANSWER": "Please provide a command answer!", diff --git a/languages/en-US/administration/addemoji.json b/languages/en-US/administration/addemoji.json index 38ac80861e..3dc5815a6c 100644 --- a/languages/en-US/administration/addemoji.json +++ b/languages/en-US/administration/addemoji.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Add an emoji to the server!", - "USAGE": "{{prefix}}addemoji [image-url] [name]", "EXAMPLES": "{{prefix}}addemoji https://via.placeholder.com/150 test-emoji", "MISSING_URL": "Please provide an image URL!", "MISSING_NAME": "Please provide an emoji name!", diff --git a/languages/en-US/administration/automod.json b/languages/en-US/administration/automod.json index 656a1b833a..720294969e 100644 --- a/languages/en-US/administration/automod.json +++ b/languages/en-US/administration/automod.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Toggle Discord invites automatic deletion", - "USAGE": "{{prefix}}automod [on/off] (#channel)", "EXAMPLES": "{{prefix}}automod on\n{{prefix}}automod off #general\n{{prefix}}automod off", "MISSING_STATUS": "Please enter a valid value between `on` and `off`", "ENABLED": "**Discord invites will be automatically deleted!**\n\n:arrow_right_hook: *Send `{{prefix}}automod off #channel` to ignore a channel!*", diff --git a/languages/en-US/administration/autorole.json b/languages/en-US/administration/autorole.json index d05a68858b..a99b10d71f 100644 --- a/languages/en-US/administration/autorole.json +++ b/languages/en-US/administration/autorole.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Toggle autorole on the server!", - "USAGE": "{{prefix}}autorole [on/off] (role)", "EXAMPLES": "{{prefix}}autorole on @Members\n{{prefix}}autorole off", "MISSING_STATUS": "Please specify a valid value between `on` and `off`", "MISSING_ROLE": "Please specify a valid role!", diff --git a/languages/en-US/administration/backup.json b/languages/en-US/administration/backup.json index a0d9b4524c..c2a385cc1c 100644 --- a/languages/en-US/administration/backup.json +++ b/languages/en-US/administration/backup.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Manage your server backups in an efficient way!", - "USAGE": "{{prefix}}backup [create/load/infos]", "EXAMPLES": "{{prefix}}backup create\n{{prefix}}backup load 558328638911545423\n{{prefix}}backup infos 558328638911545423", "MISSING_STATUS": "Select an action between: `create`, `load` and `info`!", "MISSING_BACKUP_ID": "Please enter a backup ID!", diff --git a/languages/en-US/administration/configuration.json b/languages/en-US/administration/configuration.json index 6082c40af3..b68b077cdc 100644 --- a/languages/en-US/administration/configuration.json +++ b/languages/en-US/administration/configuration.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Shows the server configuration!", - "USAGE": "{{prefix}}configuration", "EXAMPLES": "{{prefix}}configuration", "PREFIX_TITLE": "Server prefix", "IGNORED_CHANNELS_TITLE": "Ignored channel(s)", diff --git a/languages/en-US/administration/delcommand.json b/languages/en-US/administration/delcommand.json index d0864490e3..c1fa254343 100644 --- a/languages/en-US/administration/delcommand.json +++ b/languages/en-US/administration/delcommand.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Remove a custom command!", - "USAGE": "{{prefix}}delcommand [name-of-the-command]", "EXAMPLES": "{{prefix}}delcommand hey", "MISSING_NAME": "Please enter a valid custom command name!", "UNKNOWN_COMMAND": "The command {{commandName}} doesn't exist!", diff --git a/languages/en-US/administration/deletemod.json b/languages/en-US/administration/deletemod.json index acebb7cf3f..02c4aa4e27 100644 --- a/languages/en-US/administration/deletemod.json +++ b/languages/en-US/administration/deletemod.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Toggle moderation commands auto deletion!", - "USAGE": "{{prefix}}deletemod [on/off]", "EXAMPLES": "{{prefix}}deletemod on", "MISSING_STATUS": "You must specify `on` or `off`", "ENABLED": "Automatic moderation commands deletion!", diff --git a/languages/en-US/administration/goodbye.json b/languages/en-US/administration/goodbye.json index 52449c6438..027be6c9d0 100644 --- a/languages/en-US/administration/goodbye.json +++ b/languages/en-US/administration/goodbye.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Toggle goodbye messages!", - "USAGE": "{{prefix}}goodbye", "EXAMPLES": "{{prefix}}goodbye", "DEFAULT_MESSAGE": "Goodbye {user}! We're now {membercount} without you... :'(", "TEST_SUCCESS": "Test executed!", diff --git a/languages/en-US/administration/ignore.json b/languages/en-US/administration/ignore.json index 62964d6d20..0cfe71eb30 100644 --- a/languages/en-US/administration/ignore.json +++ b/languages/en-US/administration/ignore.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Toggle commands in a channel", - "USAGE": "{{prefix}}ignore [channel]", "EXAMPLES": "{{prefix}}ignore #channel", "ALLOWED": "Commands are now allowed in {{channel}}!", "IGNORED": "Commands are now forbidden in {{channel}}!" diff --git a/languages/en-US/administration/setfortniteshop.json b/languages/en-US/administration/setfortniteshop.json index 864f11beaf..4bf8c067ea 100644 --- a/languages/en-US/administration/setfortniteshop.json +++ b/languages/en-US/administration/setfortniteshop.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Set the daily Fortnite shop channel!", - "USAGE": "{{prefix}}setfortniteshop (#channel)", "EXAMPLES": "{{prefix}}setfortniteshop #shop\n{{prefix}}setfortniteshop", "DISABLED": "Daily Fortnite shop disabled!", "ENABLED": "Daily Fortnite shop enabled in {{channel}}!" diff --git a/languages/en-US/administration/setlang.json b/languages/en-US/administration/setlang.json index 3955c333cc..8d689886bb 100644 --- a/languages/en-US/administration/setlang.json +++ b/languages/en-US/administration/setlang.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Change the server language!", - "USAGE": "{{prefix}}setlang [language]", "EXAMPLES": "{{prefix}}setlang french\n{{prefix}}setlang english", "MISSING_LANG": "Please enter a valid language between theses: {{list}}", "SUCCESS": ":flag_gb: The language of this server is now english!" diff --git a/languages/en-US/administration/setmodlogs.json b/languages/en-US/administration/setmodlogs.json index 3b38eed7d2..82597ce898 100644 --- a/languages/en-US/administration/setmodlogs.json +++ b/languages/en-US/administration/setmodlogs.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Set the moderation logs channel!", - "USAGE": "{{prefix}}setmodlogs (#channel)", "EXAMPLES": "{{prefix}}setmodlogs #modlogs\n{{prefix}}setmodlogs", "SUCCESS_ENABLED": "Moderation logs will be sent in **{{channel}}**!", "SUCCESS_DISABLED": "Moderation logs channel deleted!" diff --git a/languages/en-US/administration/setprefix.json b/languages/en-US/administration/setprefix.json index b7bb3f67c7..6f039f48aa 100644 --- a/languages/en-US/administration/setprefix.json +++ b/languages/en-US/administration/setprefix.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Set the server prefix!", - "USAGE": "{{prefix}}setprefix [prefix]", "EXAMPLES": "{{prefix}}setprefix +", "MISSING_PREFIX": "Please enter a valid prefix!", "TOO_LONG": "The prefix shouldn't exceed 5 characters!", diff --git a/languages/en-US/administration/setreports.json b/languages/en-US/administration/setreports.json index c9bf2ba257..fa1e412f6b 100644 --- a/languages/en-US/administration/setreports.json +++ b/languages/en-US/administration/setreports.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Set the reports channel!", - "USAGE": "{{prefix}}setreports (#channel)", "EXAMPLES": "{{prefix}}setreports #reports\n{{prefix}}setreports", "SUCCESS_ENABLED": "Reports will be sent in **{{channel}}**!", "SUCCESS_DISABLED": "Reports channel deleted!" diff --git a/languages/en-US/administration/setsuggests.json b/languages/en-US/administration/setsuggests.json index a36d28a45a..eca0049eab 100644 --- a/languages/en-US/administration/setsuggests.json +++ b/languages/en-US/administration/setsuggests.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Set the suggestions channel!", - "USAGE": "{{prefix}}setsuggests (#channel)", "EXAMPLES": "{{prefix}}setsuggests #suggestions\n{{prefix}}setsuggests", "SUCCESS_ENABLED": "Suggestions will be sent in **{{channel}}**!", "SUCCESS_DISABLED": "Suggestions channel deleted!" diff --git a/languages/en-US/administration/slowmode.json b/languages/en-US/administration/slowmode.json index e9a64d120d..af90d68359 100644 --- a/languages/en-US/administration/slowmode.json +++ b/languages/en-US/administration/slowmode.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Set a channel cooldown", - "USAGE": "{{prefix}}slowmode [#channel] (time)", "EXAMPLES": "{{prefix}}slowmode #general 10m\n{{prefix}}slowmode #general", "DISABLED": "**Slow-mode has just been disabled in {{channel}}!**\n\n:arrow_right_hook: *Send `{{prefix}}slowmode [#channel] (time)` to enable it again!*", "ENABLED": "**A slow-mode of `{{time}}` has just been enabled in `{{channel}}`!**\n\n:arrow_right_hook: *Send `{{prefix}}slowmode {{channel}}` to disable it!*", diff --git a/languages/en-US/administration/welcome.json b/languages/en-US/administration/welcome.json index c00936d0d2..72fa80db9c 100644 --- a/languages/en-US/administration/welcome.json +++ b/languages/en-US/administration/welcome.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Toggle welcome messages!", - "USAGE": "{{prefix}}welcome", "EXAMPLES": "{{prefix}}welcome", "MISSING_STATUS": "You must specify an action between `edit` and `off`", "DEFAULT_MESSAGE": "Welcome {user} in {server}, we're now {membercount}! Your account was created {createdat}.", diff --git a/languages/en-US/economy/achievements.json b/languages/en-US/economy/achievements.json index 9a3edfd853..f8fe3dbeca 100644 --- a/languages/en-US/economy/achievements.json +++ b/languages/en-US/economy/achievements.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Shows your achievements list!", - "USAGE": "{{prefix}}achievements", "EXAMPLES": "{{prefix}}achievements", "SEND_CMD": "Send your first command!", "CLAIM_SALARY": "Claim your salary 10 times!", diff --git a/languages/en-US/economy/birthdate.json b/languages/en-US/economy/birthdate.json index a0c3aaa4a7..ffe289985d 100644 --- a/languages/en-US/economy/birthdate.json +++ b/languages/en-US/economy/birthdate.json @@ -1,8 +1,7 @@ { "DESCRIPTION": "Set the birthday date that appear on your profile", - "USAGE": "{{prefix}}birthdate (date)", "EXAMPLES": "{{prefix}}birthdate 01/12/2000", - "MISSING_DATE": "Please enter a valid date! For example, 01/12/2000", + "OPT_DATE_DESCRIPTION": "The date you were born", "INVALID_DATE": "You must use the following date format: DD/MM/YYYY. For example, `December 1, 2000` will be `01/12/2000`.", "INVALID_DATE_FORMAT": "You must use the following date format: DD/MM/YYYY. For example, `December 1, 2000` will be `01/12/2000`.", "DATE_TOO_HIGH": "More than 80 years old? :eyes:", diff --git a/languages/en-US/economy/deposit.json b/languages/en-US/economy/deposit.json index b8827fd282..88bc8bdcdb 100644 --- a/languages/en-US/economy/deposit.json +++ b/languages/en-US/economy/deposit.json @@ -1,8 +1,7 @@ { "DESCRIPTION": "Deposit your money in the bank", - "USAGE": "{{prefix}}deposit [amount]", "EXAMPLES": "{{prefix}}deposit 400", - "MISSING_AMOUNT": "Please specify an amount!", + "OPT_AMOUNT_DESCRIPTION": "The amount of money to deposit to the bank", "NO_CREDIT": "You have no credit to deposit in the bank!", "NO_ENOUGH_CREDIT": "You don't have `{{money}}` credits!", "SUCCESS": "**{{money}}** credits deposited in the bank!" diff --git a/languages/en-US/economy/divorce.json b/languages/en-US/economy/divorce.json index 1ae273cd92..b216b9bd2d 100644 --- a/languages/en-US/economy/divorce.json +++ b/languages/en-US/economy/divorce.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Divorce the person you are currently married to!", - "USAGE": "{{prefix}}divorce", "EXAMPLES": "{{prefix}}divorce", "NOT_MARRIED": "You are not currently married!", "DIVORCED": "You just divorced with **{{username}}**!" diff --git a/languages/en-US/economy/leaderboard.json b/languages/en-US/economy/leaderboard.json index 248fc64e5c..0ebf1f936e 100644 --- a/languages/en-US/economy/leaderboard.json +++ b/languages/en-US/economy/leaderboard.json @@ -1,7 +1,6 @@ { "DESCRIPTION": "Shows users who have the most credits, levels or reputation points!", - "USAGE": "{{prefix}}leaderboard [rep/levels/credits]", "EXAMPLES": "{{prefix}}leaderboard credits\n{{prefix}}leaderboard levels", - "MISSING_TYPE": "Please specify the leaderboard type between `credits`, `level` and `rep`", + "OPT_TYPE_DESCRIPTION": "The type of the leaderboard", "MOBILE": ":confused: We've detected that you are using a phone.... The leaderboard may not display well on small screens. Try to switch to landscape or go on the dashboard!" } \ No newline at end of file diff --git a/languages/en-US/economy/marry.json b/languages/en-US/economy/marry.json index 5d903bb98d..76645d5b83 100644 --- a/languages/en-US/economy/marry.json +++ b/languages/en-US/economy/marry.json @@ -1,8 +1,7 @@ { "DESCRIPTION": "Marry someone you love!", - "USAGE": "{{prefix}}marry [@member]", "EXAMPLES": "{{prefix}}marry @Androz#2091", - "INVALID_MEMBER": "You must mention a valid member!", + "OPT_USER_DESCRIPTION": "The user you want to marry", "ALREADY_MARRIED": "You are already married! First use `{{prefix}}divorce` to divorce.", "ALREADY_MARRIED_USER": "The place is taken, companion! **{{username}}** is already married!", "YOURSELF": "You can't marry yourself!", diff --git a/languages/en-US/economy/money.json b/languages/en-US/economy/money.json index f4e0d696d6..4b76da152f 100644 --- a/languages/en-US/economy/money.json +++ b/languages/en-US/economy/money.json @@ -1,6 +1,6 @@ { "DESCRIPTION": "Shows your credits", - "USAGE": "{{prefix}}money (@member)", "EXAMPLES": "{{prefix}}money\n{{prefix}}money @user#0000", + "OPT_USER_DESCRIPTION": "The user you want to display the money of", "TITLE": "{{username}}'s money" } \ No newline at end of file diff --git a/languages/en-US/economy/pay.json b/languages/en-US/economy/pay.json index 04dcc9e3c6..7604aea8c6 100644 --- a/languages/en-US/economy/pay.json +++ b/languages/en-US/economy/pay.json @@ -1,11 +1,11 @@ { "DESCRIPTION": "Send money to someone!", - "USAGE": "{{prefix}}pay [@member] [amount]", "EXAMPLES": "{{prefix}}pay Androz#2091 100", - "INVALID_MEMBER": "You must mention a valid member!", + "OPT_USER_DESCRIPTION": "The user you want to pay", + "OPT_AMOUNT_DESCRIPTION": "The amount you want to pay", "BOT_USER": "Bots are already rich πŸ’°!", "YOURSELF": "You can't pay yourself!", - "INVALID_AMOUNT": "You must specify a valid amount", + "POSITIVE_INT_AMOUNT": "The amount should be a positive integer", "ENOUGH_MONEY": "You can't afford **{{amount}}**", "SUCCESS": "You just paid **{{amount}}** to **{{username}}**!" } \ No newline at end of file diff --git a/languages/en-US/economy/profile.json b/languages/en-US/economy/profile.json index 7fd9291824..764365654b 100644 --- a/languages/en-US/economy/profile.json +++ b/languages/en-US/economy/profile.json @@ -1,7 +1,7 @@ { "DESCRIPTION": "Shows the mentioned user or author profile", - "USAGE": "{{prefix}}profile [user]", "EXAMPLES": "{{prefix}}profile Androz#2091", + "OPT_USER_DESCRIPTION": "The user you want to show the profile of", "TITLE": "{{username}}'s profile", "NO_BIO": "", "BOT_USER": "Bots don't have profile page!", diff --git a/languages/en-US/economy/rep.json b/languages/en-US/economy/rep.json index 4dab04347f..2b69d03c51 100644 --- a/languages/en-US/economy/rep.json +++ b/languages/en-US/economy/rep.json @@ -1,9 +1,8 @@ { "DESCRIPTION": "Give a reputation point to someone!", - "USAGE": "{{prefix}}rep [user]", "EXAMPLES": "{{prefix}}rep @Androz#2091", + "OPT_USER_DESCRIPTION": "The user you want to give a reputation point to", "COOLDOWN": "You have to wait {{time}} before being able to `rep` someone!", - "INVALID_USER": "You must mention a valid user!", "BOT_USER": "Bots don't accept reputation points!", "YOURSELF": "You can't give yourself a reputation point!", "SUCCESS": "You just gave a reputation point to {{username}}!" diff --git a/languages/en-US/economy/rob.json b/languages/en-US/economy/rob.json index 6b8324624c..18bd393cbc 100644 --- a/languages/en-US/economy/rob.json +++ b/languages/en-US/economy/rob.json @@ -1,10 +1,9 @@ { "DESCRIPTION": "Try to rob a member!", - "USAGE": "{{prefix}}rob [@member] [amount]", "EXAMPLES": "{{prefix}}rob @Androz#2091 100", + "OPT_USER_DESCRIPTION": "The user you want to rob", + "OPT_AMOUNT_DESCRIPTION": "The amount you want to try to rob", "YOURSELF": "You can't rob yourself!", - "MISSING_MEMBER": "You must specify a valid member to rob!", - "MISSING_AMOUNT": "Please enter a valid amount!", "NOT_ENOUGH_AUTHOR": "You must have more than **{{moneyMin}}** credits to attempt this robbery (you have **{{moneyCurrent}}** credits for now)!", "NOT_ENOUGH_MEMBER": "You can't try your robbery because **{{username}}** doesn't have as many credits in cash!", "COOLDOWN": "πŸ•΅οΈ **{{username}}** is on guard.... Wait a while and try again!", diff --git a/languages/en-US/economy/setbio.json b/languages/en-US/economy/setbio.json index 1e46ad9594..c600b72915 100644 --- a/languages/en-US/economy/setbio.json +++ b/languages/en-US/economy/setbio.json @@ -1,8 +1,7 @@ { "DESCRIPTION": "Change your biography!", - "USAGE": "{{prefix}}setbio [biography]", "EXAMPLES": "{{prefix}}setbio My name is Jake, I'm 19 and I love programming!", - "MISSING": "You must specify a biography!", + "OPT_BIO_DESCRIPTION": "Your new biography", "MAX_CHARACT": "Your biography must not exceed 500 characters!", "SUCCESS": "Your biography has been modified!" } \ No newline at end of file diff --git a/languages/en-US/economy/slots.json b/languages/en-US/economy/slots.json index 1eb8973c6b..78c4214889 100644 --- a/languages/en-US/economy/slots.json +++ b/languages/en-US/economy/slots.json @@ -1,7 +1,7 @@ { "DESCRIPTION": "The Atlanta casino", - "USAGE": "{{prefix}}slots [amount]", "EXAMPLES": "{{prefix}}slots\n{{prefix}}slots 10", + "OPT_AMOUNT_DESCRIPTION": "The amount of money you want to play with", "DEFEAT": "**{{username}}** used {{money}} credit(s) and lost everything.", "VICTORY": "**{{username}}** used {{money}} credit(s) and won {{won}} credit(s)!", "NOT_ENOUGH": "You need at least **{{money}}** credit(s)." diff --git a/languages/en-US/economy/withdraw.json b/languages/en-US/economy/withdraw.json index cbc9896a7c..9643ae1655 100644 --- a/languages/en-US/economy/withdraw.json +++ b/languages/en-US/economy/withdraw.json @@ -1,8 +1,7 @@ { "DESCRIPTION": "Withdraw money!", - "USAGE": "{{prefix}}withdraw [amount]", "EXAMPLES": "{{prefix}}withdraw 400", - "MISSING_AMOUNT": "Please specify an amount to be withdrawn!", + "OPT_AMOUNT_DESCRIPTION": "The amount you want to widthdraw from the bank", "NO_CREDIT": "You don't have any credit in your bank!", "NOT_ENOUGH": "You need at least `{{money}}` credit(s)!", "SUCCESS": "**{{money}}** credit(s) withdrawn!" diff --git a/languages/en-US/economy/work.json b/languages/en-US/economy/work.json index 19aeb094ed..584a67435e 100644 --- a/languages/en-US/economy/work.json +++ b/languages/en-US/economy/work.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Claim your salary!", - "USAGE": "{{prefix}}work", "EXAMPLES": "{{prefix}}work", "COOLDOWN": "You have to wait {{time}} before working again!", "AWARD": "Complete the word AWARD to win 200 bonus credits!", diff --git a/languages/en-US/fun/8ball.json b/languages/en-US/fun/8ball.json index 32e7281a54..61d4a7e7ab 100644 --- a/languages/en-US/fun/8ball.json +++ b/languages/en-US/fun/8ball.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "I'm telling you the truth!", - "USAGE": "{{prefix}}8ball [question]", "EXAMPLES": "{{prefix}}8ball Is Atlanta the best Discord bot?", "ERR_QUESTION": "You must enter a question!", "RESPONSE_1": "I'm sure of it.", diff --git a/languages/en-US/fun/ascii.json b/languages/en-US/fun/ascii.json index 32e31c5c76..04c73a3213 100644 --- a/languages/en-US/fun/ascii.json +++ b/languages/en-US/fun/ascii.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Turn your text into ascii characters!", - "USAGE": "{{prefix}}ascii [text]", "EXAMPLES": "{{prefix}}ascii Hello world!", "TEXT_MISSING": "Please enter a valid text (less than 20 characters)!" } \ No newline at end of file diff --git a/languages/en-US/fun/choice.json b/languages/en-US/fun/choice.json index 71eee58b63..6b2ff4c411 100644 --- a/languages/en-US/fun/choice.json +++ b/languages/en-US/fun/choice.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Helps you choose between the given choices!", - "USAGE": "{{prefix}}choice [choice1/choice2/etc...]", "EXAMPLES": "{{prefix}}choice Fire/Wind/Water", "MISSING": "You must enter more than two choices!\n(or use the `flip` command instead)", "EMPTY": "One of your choices seems to be empty.... Please try again!", diff --git a/languages/en-US/fun/findwords.json b/languages/en-US/fun/findwords.json index 038a59151c..09b176fc68 100644 --- a/languages/en-US/fun/findwords.json +++ b/languages/en-US/fun/findwords.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Start a Findwords party, a game where you have to find words!", - "USAGE": "{{prefix}}findwords", "EXAMPLES": "{{prefix}}findwords", "INVALID_WORD": "{{member}} | Your word is not valid!", "GAME_STARTING": ":timer: | The game starts in 10 seconds!", diff --git a/languages/en-US/fun/flip.json b/languages/en-US/fun/flip.json index 6862e6f7b4..19d06249b5 100644 --- a/languages/en-US/fun/flip.json +++ b/languages/en-US/fun/flip.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "I roll the dice for you!", - "USAGE": "{{prefix}}flip", "EXAMPLES": "{{prefix}}flip", "HEADS": "🎲 | Heads!", "TAILS": "🎲 | Tails!" diff --git a/languages/en-US/fun/fml.json b/languages/en-US/fun/fml.json index 8db6c0d139..18fa78c431 100644 --- a/languages/en-US/fun/fml.json +++ b/languages/en-US/fun/fml.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Gets a random FML", - "USAGE": "{{prefix}}fml", "EXAMPLES": "{{prefix}}fml", "FOOTER": "blague.xyz | By Skiz#0001" } \ No newline at end of file diff --git a/languages/en-US/fun/joke.json b/languages/en-US/fun/joke.json index 12174323dc..fb2e47379c 100644 --- a/languages/en-US/fun/joke.json +++ b/languages/en-US/fun/joke.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Gets a wonderful joke specially made for you!", - "USAGE": "{{prefix}}joke", "EXAMPLES": "{{prefix}}joke", "FOOTER": "blague.xyz | By Skiz#0001" } \ No newline at end of file diff --git a/languages/en-US/fun/lmg.json b/languages/en-US/fun/lmg.json index ae470bc4f8..9aa51fb133 100644 --- a/languages/en-US/fun/lmg.json +++ b/languages/en-US/fun/lmg.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Generate a LMGTFY link with your search", - "USAGE": "{{prefix}}lmg [search]", "EXAMPLES": "{{prefix}}lmg How to create a Discord bot?", "MISSING": "You must specify a search!" } \ No newline at end of file diff --git a/languages/en-US/fun/lovecalc.json b/languages/en-US/fun/lovecalc.json index fffbc79b57..c16ad2ee39 100644 --- a/languages/en-US/fun/lovecalc.json +++ b/languages/en-US/fun/lovecalc.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "How much love is there between two people?\n*This is a fun command, not to be taken seriously*", - "USAGE": "{{prefix}}lovecalc [@member1] (@member2)", "EXAMPLES": "{{prefix}}lovecalc @Androz#2091\n{{prefix}}lovecalc @Androz#2091 @Atlanta#6770", "MISSING": "You must mention two members!", "CONTENT": "There's **{{percent}}%** of love between **{{firstUsername}}** and **{{secondUsername}}**!\n**Congrats!**" diff --git a/languages/en-US/fun/number.json b/languages/en-US/fun/number.json index b16c7e56a0..793cf5f2e9 100644 --- a/languages/en-US/fun/number.json +++ b/languages/en-US/fun/number.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Find the right number!", - "USAGE": "{{prefix}}number", "EXAMPLES": "{{prefix}}number", "GAME_START": "Number chosen, you can start!", "BIG": "{{user}} | My number is **bigger** than `{{number}}`!", diff --git a/languages/en-US/general/calc.json b/languages/en-US/general/calc.json index 5c1e464c26..f0b8ace254 100644 --- a/languages/en-US/general/calc.json +++ b/languages/en-US/general/calc.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Calculator able to solve complex operations and to convert units!", - "USAGE": "{{prefix}}calc [calculation]", "EXAMPLES": "{{prefix}}10*5+sin(3)\n{{prefix}}calc 10cm to m", "MISSING_CALC": "Please enter a calculation!", "INVALID_CALC": "Please enter a **valid** calculation!", diff --git a/languages/en-US/general/fortnite.json b/languages/en-US/general/fortnite.json index 4eafda6043..759bcfd0c7 100644 --- a/languages/en-US/general/fortnite.json +++ b/languages/en-US/general/fortnite.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Shows a player's Fortnite stats!", - "USAGE": "{{prefix}}fortnite [psn/xbl/pc] [pseudo]", "EXAMPLES": "{{prefix}}fortnite pc Ninja", "MISSING_PLATFORM": "Please specify a platform between `psn`, `pc` or `xbl`!", "MISSING_USERNAME": "Please enter a valid epic games username!", diff --git a/languages/en-US/general/fortniteshop.json b/languages/en-US/general/fortniteshop.json index 719983be86..7921c27cd0 100644 --- a/languages/en-US/general/fortniteshop.json +++ b/languages/en-US/general/fortniteshop.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Shows the daily fortnite items shop!", - "USAGE": "{{prefix}}fortniteshop", "EXAMPLES": "{{prefix}}fortniteshop", "HEADER": "FORTNITE ITEMS SHOP", "DAILY": "DAILY", diff --git a/languages/en-US/general/github.json b/languages/en-US/general/github.json index 440312dbb9..95eebe91ed 100644 --- a/languages/en-US/general/github.json +++ b/languages/en-US/general/github.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Shows Atlanta's Github repository information!", - "USAGE": "{{prefix}}github", "EXAMPLES": "{{prefix}}github", "CLICK_HERE": "Click here to access the github of Atlanta", "LANGUAGE": "Programming language", diff --git a/languages/en-US/general/hastebin.json b/languages/en-US/general/hastebin.json index d8097a7cd8..df50d543f8 100644 --- a/languages/en-US/general/hastebin.json +++ b/languages/en-US/general/hastebin.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Upload your text on hastebin!", - "USAGE": "{{prefix}}hastebin [text]", "EXAMPLES": "{{prefix}}hastebin Hello World!", "MISSING_TEXT": "Please enter a valid text!", "SUCCESS": "Upload complete!" diff --git a/languages/en-US/general/help.json b/languages/en-US/general/help.json index b81125921a..7e31a68c76 100644 --- a/languages/en-US/general/help.json +++ b/languages/en-US/general/help.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Show commands list or specific command help.", - "USAGE": "{{prefix}}help (command)", "EXAMPLES": "{{prefix}}help\n{{prefix}}help ping", "CUSTOM": "A custom command doesn't have help page.", "NOT_FOUND": "`{{search}}` is not a valid command", diff --git a/languages/en-US/general/invitations.json b/languages/en-US/general/invitations.json index 47e18aa5ba..79f1a5ed07 100644 --- a/languages/en-US/general/invitations.json +++ b/languages/en-US/general/invitations.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Shows the number of people you have invited to the server!", - "USAGE": "{{prefix}}invitations (@member)", "EXAMPLES": "{{prefix}}invitations\n{{prefix}}invitations @Androz#2091", "NOBODY_AUTHOR": "You didn't invite anyone to the server!", "NOBODY_MEMBER": "{{member}} didn't invite anyone to the server!", diff --git a/languages/en-US/general/invite.json b/languages/en-US/general/invite.json index 253001c692..0938b586a5 100644 --- a/languages/en-US/general/invite.json +++ b/languages/en-US/general/invite.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Shows Atlanta links!", - "USAGE": "{{prefix}}invite (copy)", "EXAMPLES": "{{prefix}}invite\n{{prefix}}invite copy", "LINKS": "Atlanta links", "TIP": "Send `{{prefix}}invite copy` to be able to copy the invite link!", diff --git a/languages/en-US/general/minecraft.json b/languages/en-US/general/minecraft.json index 37949229e6..1d0fd0e8e6 100644 --- a/languages/en-US/general/minecraft.json +++ b/languages/en-US/general/minecraft.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Shows information about a Minecraft server!", - "USAGE": "{{prefix}}minecraft [ip]", "EXAMPLES": "{{prefix}}minecraft mc.hypixel.net", "MISSING_IP": "Please enter a valid IP address!", "FAILED": "This server is offline or blocking access!", diff --git a/languages/en-US/general/permissions.json b/languages/en-US/general/permissions.json index 5b83333d59..e7f51d6178 100644 --- a/languages/en-US/general/permissions.json +++ b/languages/en-US/general/permissions.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Displays the member's permissions in the channel", - "USAGE": "{{prefix}}permissions (@member)", "EXAMPLES": "{{prefix}}permissions\n{{prefix}}permissions @Androz#2091", "TITLE": "{{user}}'s permissions in {{channel}}" } \ No newline at end of file diff --git a/languages/en-US/general/ping.json b/languages/en-US/general/ping.json index d99539b270..2ceb42891f 100644 --- a/languages/en-US/general/ping.json +++ b/languages/en-US/general/ping.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Show bot's ping", - "USAGE": "{{prefix}}ping", "EXAMPLES": "{{prefix}}ping", "CONTENT": "Pong! My ping is `{{ping}}` ms." } \ No newline at end of file diff --git a/languages/en-US/general/quote.json b/languages/en-US/general/quote.json index a0b828e504..7b5248a106 100644 --- a/languages/en-US/general/quote.json +++ b/languages/en-US/general/quote.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Quote a message in the channel!", - "USAGE": "{{prefix}}quote [messageID] [channel]", "EXAMPLES": "{{prefix}}quote 596018101921906698\n{{prefix}}quote 596018101921906698 573508780520898581\n{{prefix}}quote 596018101921906698 #blabla", "NO_MESSAGE_ID": "No message has this ID.", "NO_CHANNEL_ID": "No channel has this ID.", diff --git a/languages/en-US/general/remindme.json b/languages/en-US/general/remindme.json index c27a272300..75e2cf9952 100644 --- a/languages/en-US/general/remindme.json +++ b/languages/en-US/general/remindme.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Add a new personal reminder", - "USAGE": "{{prefix}}remindme [message]", "EXAMPLES": "{{prefix}}remindme 24h Work command\n{{prefix}}remindme 3m Take the pasta out of the pan!", "MISSING_MESSAGE": "You must enter a message!", "SAVED": "Reminder saved, you will receive a message at the end of the time!", diff --git a/languages/en-US/general/report.json b/languages/en-US/general/report.json index 10c7d119b5..df073d7722 100644 --- a/languages/en-US/general/report.json +++ b/languages/en-US/general/report.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Send your report to the channel defined for them!", - "USAGE": "{{prefix}}report [@user] [reason]", "EXAMPLES": "{{prefix}}report @Androz#2091 Breaking the rules", "MISSING_CHANNEL": "No report channel defined!", "MISSING_REASON": "Please enter a report reason!", diff --git a/languages/en-US/general/serverinfo.json b/languages/en-US/general/serverinfo.json index 76e0a06e9b..186151bb1a 100644 --- a/languages/en-US/general/serverinfo.json +++ b/languages/en-US/general/serverinfo.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Shows information about the server!", - "USAGE": "{{prefix}}serverinfo [ID/Name]", "EXAMPLES": "{{prefix}}serverinfo Atlanta\n{{prefix}}serverinfo", "AFK_CHANNEL": "AFK channel", "NO_AFK_CHANNEL": "No AFK channel", diff --git a/languages/en-US/general/setafk.json b/languages/en-US/general/setafk.json index 592f742db6..b31d7bae0b 100644 --- a/languages/en-US/general/setafk.json +++ b/languages/en-US/general/setafk.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Become AFK (members who mention you will receive a message)", - "USAGE": "{{prefix}}setafk [reason]", "EXAMPLES": "{{prefix}}setafk I'm eating =)", "MISSING_REASON": "Please specify the reason for your AFK status!", "SUCCESS": "You're now AFK (reason: {{reason}})", diff --git a/languages/en-US/general/shorturl.json b/languages/en-US/general/shorturl.json index bfc17ee507..0e0d0943d3 100644 --- a/languages/en-US/general/shorturl.json +++ b/languages/en-US/general/shorturl.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Make your links shorter!", - "USAGE": "{{prefix}}shorturl [url]", "EXAMPLES": "{{prefix}}shorturl https://google.fr", "MISSING_URL": "Please enter a valid URL!" } \ No newline at end of file diff --git a/languages/en-US/general/someone.json b/languages/en-US/general/someone.json index e7b1f8dac9..db37f67d55 100644 --- a/languages/en-US/general/someone.json +++ b/languages/en-US/general/someone.json @@ -1,5 +1,4 @@ { "DESCRIPTION": "Pick a random member on the server!", - "USAGE": "{{prefix}}someone", "EXAMPLES": "{{prefix}}someone" } \ No newline at end of file diff --git a/languages/en-US/general/staff.json b/languages/en-US/general/staff.json index 3371e60e12..513904c158 100644 --- a/languages/en-US/general/staff.json +++ b/languages/en-US/general/staff.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Shows the server staff members list!", - "USAGE": "{{prefix}}staff", "EXAMPLES": "{{prefix}}staff", "TITLE": "{{guild}} staff", "ADMINS": "Administrators", diff --git a/languages/en-US/general/stats.json b/languages/en-US/general/stats.json index 2fa8f3d4ad..99651005a8 100644 --- a/languages/en-US/general/stats.json +++ b/languages/en-US/general/stats.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Shows the bot stats!", - "USAGE": "{{prefix}}stats", "EXAMPLES": "{{prefix}}stats", "COUNTS_TITLE": "β€’ __Statistics__", "COUNTS_CONTENT": "`Servers: {{servers}}`\n`Users: {{users}}`", diff --git a/languages/en-US/general/suggest.json b/languages/en-US/general/suggest.json index 60f7913ad6..0bfe52a2e4 100644 --- a/languages/en-US/general/suggest.json +++ b/languages/en-US/general/suggest.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Send your suggestion to the defined channel!", - "USAGE": "{{prefix}}suggest [message]", "EXAMPLES": "{{prefix}}suggest New channel #offtopic please", "MISSING_CHANNEL": "No suggestion channel defined!", "MISSING_CONTENT": "Please enter a suggestion!", diff --git a/languages/en-US/general/translate.json b/languages/en-US/general/translate.json index 905e3c9eff..9dad3f2729 100644 --- a/languages/en-US/general/translate.json +++ b/languages/en-US/general/translate.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Translate your text!", - "USAGE": "{{prefix}}translate [language] [message]", "EXAMPLES": "{{prefix}}translate fr How are you ?", "LIST_SENT": "The languages list has just been sent to you by private messages!", "MISSING_LANGUAGE": "Please enter a language! To display the languages list, type `{{prefix}}translate langs-list`!", diff --git a/languages/en-US/general/userinfo.json b/languages/en-US/general/userinfo.json index db45357f4a..0ed61c51a0 100644 --- a/languages/en-US/general/userinfo.json +++ b/languages/en-US/general/userinfo.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Shows user information!", - "USAGE": "{{prefix}}userinfo (@user/userID)", "EXAMPLES": "{{prefix}}userinfo\n{{prefix}}userinfo @Androz#2091\n{{prefix}}userinfo 422820341791064085", "INVALID_USER": "No user on Discord has the `{{search}}` ID!", "NO_GAME": "Not playing", diff --git a/languages/en-US/images/approved.json b/languages/en-US/images/approved.json index 1ecfea6a38..1a9a5d41da 100644 --- a/languages/en-US/images/approved.json +++ b/languages/en-US/images/approved.json @@ -1,5 +1,4 @@ { "DESCRIPTION": "Generates a \"approved\" image", - "USAGE": "{{prefix}}approved (@member)", "EXAMPLES": "{{prefix}}approved\n{{prefix}}approved @Androz#2091" } \ No newline at end of file diff --git a/languages/en-US/images/avatar.json b/languages/en-US/images/avatar.json index 6fc21a6a46..10397dd4bb 100644 --- a/languages/en-US/images/avatar.json +++ b/languages/en-US/images/avatar.json @@ -1,5 +1,4 @@ { "DESCRIPTION": "Shows the avatar of the mentionned member", - "USAGE": "{{prefix}}avatar (@member)", "EXAMPLES": "{{prefix}}avatar\n{{prefix}}avatar @Androz#2091" } \ No newline at end of file diff --git a/languages/en-US/images/batslap.json b/languages/en-US/images/batslap.json index d0e5adbf79..63c0ec648f 100644 --- a/languages/en-US/images/batslap.json +++ b/languages/en-US/images/batslap.json @@ -1,5 +1,4 @@ { "DESCRIPTION": "Generates a \"batslap\" image", - "USAGE": "{{prefix}}batslap (@member1) (@member2)", "EXAMPLES": "{{prefix}}batslap\n{{prefix}}batslap @Androz#2091 @Androz#2091" } \ No newline at end of file diff --git a/languages/en-US/images/beautiful.json b/languages/en-US/images/beautiful.json index cd20272b72..5569e0f185 100644 --- a/languages/en-US/images/beautiful.json +++ b/languages/en-US/images/beautiful.json @@ -1,5 +1,4 @@ { "DESCRIPTION": "Generates a \"beautiful\" image", - "USAGE": "{{prefix}}beautiful (@member)", "EXAMPLES": "{{prefix}}beautiful\n{{prefix}}beautiful @Androz#2091" } \ No newline at end of file diff --git a/languages/en-US/images/bed.json b/languages/en-US/images/bed.json index 777c526ef9..e24d858d31 100644 --- a/languages/en-US/images/bed.json +++ b/languages/en-US/images/bed.json @@ -1,5 +1,4 @@ { "DESCRIPTION": "Generates a \"love\" image using the Nekobot API", - "USAGE": "{{prefix}}love [@member1] (@member2)", "EXAMPLES": "{{prefix}}love @Androz#2091\n{{prefix}}love @Androz#2091 @Marty#0303" } \ No newline at end of file diff --git a/languages/en-US/images/brazzers.json b/languages/en-US/images/brazzers.json index 3f0393cc8a..f5f2ecf9de 100644 --- a/languages/en-US/images/brazzers.json +++ b/languages/en-US/images/brazzers.json @@ -1,5 +1,4 @@ { "DESCRIPTION": "Generates a \"dictator\" image", - "USAGE": "{{prefix}}dictator (@member)", "EXAMPLES": "{{prefix}}dictator\n{{prefix}}dictator @Androz#2091" } \ No newline at end of file diff --git a/languages/en-US/images/burn.json b/languages/en-US/images/burn.json index 66dc89be8d..0af2b2e824 100644 --- a/languages/en-US/images/burn.json +++ b/languages/en-US/images/burn.json @@ -1,5 +1,4 @@ { "DESCRIPTION": "Generates a \"brazzers\" image", - "USAGE": "{{prefix}}brazzers (@member)", "EXAMPLES": "{{prefix}}brazzers\n{{prefix}}brazzers @Androz#2091" } \ No newline at end of file diff --git a/languages/en-US/images/captcha.json b/languages/en-US/images/captcha.json index cf43aeb52f..d389efeda1 100644 --- a/languages/en-US/images/captcha.json +++ b/languages/en-US/images/captcha.json @@ -1,5 +1,4 @@ { "DESCRIPTION": "Generates a \"captcha\" image using the Nekobot API", - "USAGE": "{{prefix}}captcha (@member)", "EXAMPLES": "{{prefix}}captcha\n{{prefix}}captcha @Androz#2091" } \ No newline at end of file diff --git a/languages/en-US/images/challenger.json b/languages/en-US/images/challenger.json index 2bddf422c7..1ac822e095 100644 --- a/languages/en-US/images/challenger.json +++ b/languages/en-US/images/challenger.json @@ -1,5 +1,4 @@ { "DESCRIPTION": "Generates a \"challenger\" image", - "USAGE": "{{prefix}}challenger (@member)", "EXAMPLES": "{{prefix}}challenger\n{{prefix}}challenger @Androz#2091" } \ No newline at end of file diff --git a/languages/en-US/images/clyde.json b/languages/en-US/images/clyde.json index a2319f3089..a045c1fd5e 100644 --- a/languages/en-US/images/clyde.json +++ b/languages/en-US/images/clyde.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Generates a \"Clyde\" message image using the Nekobot API", - "USAGE": "{{prefix}}clyde [text]", "EXAMPLES": "{{prefix}}clyde Discord will close on December 11, 2002. Goodbye.", "MISSING_TEXT": "Please specify the message text!" } \ No newline at end of file diff --git a/languages/en-US/images/dictator.json b/languages/en-US/images/dictator.json index 6e3da8086d..a8c8a98282 100644 --- a/languages/en-US/images/dictator.json +++ b/languages/en-US/images/dictator.json @@ -1,5 +1,4 @@ { "DESCRIPTION": "Generates a \"burn\" image", - "USAGE": "{{prefix}}burn (@member)", "EXAMPLES": "{{prefix}}burn\n{{prefix}}burn @Androz#2091" } \ No newline at end of file diff --git a/languages/en-US/images/facepalm.json b/languages/en-US/images/facepalm.json index c1ecc89c0e..a4710c6a4d 100644 --- a/languages/en-US/images/facepalm.json +++ b/languages/en-US/images/facepalm.json @@ -1,5 +1,4 @@ { "DESCRIPTION": "Generates a \"facepalm\" image using canvas", - "USAGE": "{{prefix}}facepalm (@member)", "EXAMPLES": "{{prefix}}facepalm\n{{prefix}}facepalm Androz#2091" } \ No newline at end of file diff --git a/languages/en-US/images/fire.json b/languages/en-US/images/fire.json index 48c516c3d8..d7cffaaa6c 100644 --- a/languages/en-US/images/fire.json +++ b/languages/en-US/images/fire.json @@ -1,5 +1,4 @@ { "DESCRIPTION": "Generates a \"fire\" image using Amethyste API", - "USAGE": "{{prefix}}fire (@member)", "EXAMPLES": "{{prefix}}fire\n{{prefix}}fire @Androz#2091" } \ No newline at end of file diff --git a/languages/en-US/images/jail.json b/languages/en-US/images/jail.json index b894d95f23..277e3749ad 100644 --- a/languages/en-US/images/jail.json +++ b/languages/en-US/images/jail.json @@ -1,5 +1,4 @@ { "DESCRIPTION": "Generates a \"jail\" image using Amethyste API", - "USAGE": "{{prefix}}jail (@member)", "EXAMPLES": "{{prefix}}jail\n{{prefix}}jail @Androz#2091" } \ No newline at end of file diff --git a/languages/en-US/images/love.json b/languages/en-US/images/love.json index 16e5eb5039..397d61401e 100644 --- a/languages/en-US/images/love.json +++ b/languages/en-US/images/love.json @@ -1,5 +1,4 @@ { "DESCRIPTION": "Generates a \"bed\" image", - "USAGE": "{{prefix}}bed [@member1] (@member2)", "EXAMPLES": "{{prefix}}bed @Androz#2091\n{{prefix}}bed @Androz#2091 @Marty#0303" } \ No newline at end of file diff --git a/languages/en-US/images/mission.json b/languages/en-US/images/mission.json index b94f6a1a06..b5552cc52d 100644 --- a/languages/en-US/images/mission.json +++ b/languages/en-US/images/mission.json @@ -1,5 +1,4 @@ { "DESCRIPTION": "Generates a \"mission\" image using Amethyste API", - "USAGE": "{{prefix}}mission (@member)", "EXAMPLES": "{{prefix}}mission\n{{prefix}}mission @Androz#2091" } \ No newline at end of file diff --git a/languages/en-US/images/phcomment.json b/languages/en-US/images/phcomment.json index 13486a9d88..66ec5793df 100644 --- a/languages/en-US/images/phcomment.json +++ b/languages/en-US/images/phcomment.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Generates a \"phcomment\" image", - "USAGE": "{{prefix}}phcomment (@member) [text]", "EXAMPLES": "{{prefix}}phcomment Hi!\n{{prefix}}phcomment @Androz#2091 Hi!", "MISSING_TEXT": "Please specify the comment text!" } \ No newline at end of file diff --git a/languages/en-US/images/qrcode.json b/languages/en-US/images/qrcode.json index 33da955dfc..9a6e91adcb 100644 --- a/languages/en-US/images/qrcode.json +++ b/languages/en-US/images/qrcode.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Generates a QR code image from a given text", - "USAGE": "{{prefix}}qrcode [text]", "EXAMPLES": "{{prefix}}qrcode Hello", "MISSING_TEXT": "Please specify the QR code source text!", "SUCCESS": "Here's your QRCode!" diff --git a/languages/en-US/images/rip.json b/languages/en-US/images/rip.json index a7b8840df4..7799506dc2 100644 --- a/languages/en-US/images/rip.json +++ b/languages/en-US/images/rip.json @@ -1,5 +1,4 @@ { "DESCRIPTION": "Generates a \"rip\" image using Nekobot API", - "USAGE": "{{prefix}}rip (@member)", "EXAMPLES": "{{prefix}}rip\n{{prefix}}rip @Androz#2091" } \ No newline at end of file diff --git a/languages/en-US/images/scary.json b/languages/en-US/images/scary.json index 04a4b0ce21..046319760d 100644 --- a/languages/en-US/images/scary.json +++ b/languages/en-US/images/scary.json @@ -1,5 +1,4 @@ { "DESCRIPTION": "Generates a \"scary\" image using Nekobot API", - "USAGE": "{{prefix}}scary (@member)", "EXAMPLES": "{{prefix}}scary\n{{prefix}}scary @Androz#2091" } \ No newline at end of file diff --git a/languages/en-US/images/tobecontinued.json b/languages/en-US/images/tobecontinued.json index 04f0584621..8b820ef506 100644 --- a/languages/en-US/images/tobecontinued.json +++ b/languages/en-US/images/tobecontinued.json @@ -1,5 +1,4 @@ { "DESCRIPTION": "Generates a \"tobecontinued\" image using Nekobot API", - "USAGE": "{{prefix}}tobecontinued (@member)", "EXAMPLES": "{{prefix}}tobecontinued\n{{prefix}}tobecontinued @Androz#2091" } \ No newline at end of file diff --git a/languages/en-US/images/trash.json b/languages/en-US/images/trash.json index fe656dc0c0..6b20f59491 100644 --- a/languages/en-US/images/trash.json +++ b/languages/en-US/images/trash.json @@ -1,5 +1,4 @@ { "DESCRIPTION": "Generates a \"trash\" image", - "USAGE": "{{prefix}}trash (@member)", "EXAMPLES": "{{prefix}}trash\n{{prefix}}trash @Androz#2091" } \ No newline at end of file diff --git a/languages/en-US/images/triggered.json b/languages/en-US/images/triggered.json index 544d69d5a9..f7c82e1dd1 100644 --- a/languages/en-US/images/triggered.json +++ b/languages/en-US/images/triggered.json @@ -1,5 +1,4 @@ { "DESCRIPTION": "Generates a \"triggered\" image using Nekobot API", - "USAGE": "{{prefix}}triggered (@member)", "EXAMPLES": "{{prefix}}triggered\n{{prefix}}triggered @Androz#2091" } \ No newline at end of file diff --git a/languages/en-US/images/tweet.json b/languages/en-US/images/tweet.json index 748987efd2..31b53016d3 100644 --- a/languages/en-US/images/tweet.json +++ b/languages/en-US/images/tweet.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Generates a \"tweet\" image using Nekobot API", - "USAGE": "{{prefix}}tweet [@twitter_username] [content]", "EXAMPLES": "{{prefix}}tweet @ElonMusk Hello", "MISSING_USERNAME": "You have to enter someone's twitter nickname!", "MISSING_TEXT": "You have to specify the tweet content!", diff --git a/languages/en-US/images/wanted.json b/languages/en-US/images/wanted.json index cecc164f56..e37fb07722 100644 --- a/languages/en-US/images/wanted.json +++ b/languages/en-US/images/wanted.json @@ -1,5 +1,4 @@ { "DESCRIPTION": "Generates a \"wanted\" image using Nekobot API", - "USAGE": "{{prefix}}wanted (@member)", "EXAMPLES": "{{prefix}}wanted\n{{prefix}}wanted @Androz#2091" } \ No newline at end of file diff --git a/languages/en-US/images/wasted.json b/languages/en-US/images/wasted.json index 19285d9fed..f38255f671 100644 --- a/languages/en-US/images/wasted.json +++ b/languages/en-US/images/wasted.json @@ -1,5 +1,4 @@ { "DESCRIPTION": "Generates a \"wasted\" image using Nekobot API", - "USAGE": "{{prefix}}wasted (@member)", "EXAMPLES": "{{prefix}}wasted\n{{prefix}}wasted @Androz#2091" } \ No newline at end of file diff --git a/languages/en-US/images/youtube-comment.json b/languages/en-US/images/youtube-comment.json index 06387ef986..8966e70dee 100644 --- a/languages/en-US/images/youtube-comment.json +++ b/languages/en-US/images/youtube-comment.json @@ -1,5 +1,4 @@ { "DESCRIPTION": "Generates a \"youtube-comment\" image", - "USAGE": "{{prefix}}youtube-comment (@member) [text]", "EXAMPLES": "{{prefix}}youtube-comment Hi!\n{{prefix}}youtube-comment @Androz#2091 Hi!" } \ No newline at end of file diff --git a/languages/en-US/misc.json b/languages/en-US/misc.json index 6a0de10e5c..789acc3521 100644 --- a/languages/en-US/misc.json +++ b/languages/en-US/misc.json @@ -24,5 +24,6 @@ "NSFW_COMMAND": "You must execute this command in a channel that allows NSFW!", "OWNER_ONLY": "Only the owner of Atlanta can do these commands!", "COOLDOWNED": "You must wait **{{seconds}}** second(s) to be able to run this command again!", - "CANNOT_DM": "I don't have permission to send you private messages... Please update your privacy settings!" + "CANNOT_DM": "I don't have permission to send you private messages... Please update your privacy settings!", + "USER_NOT_SERVER": "This user is not in the current server." } \ No newline at end of file diff --git a/languages/en-US/moderation/announcement.json b/languages/en-US/moderation/announcement.json index 5505845813..b67cbe5673 100644 --- a/languages/en-US/moderation/announcement.json +++ b/languages/en-US/moderation/announcement.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Send an announcement in the current channel!", - "USAGE": "{{prefix}}announcement [text]", "EXAMPLES": "{{prefix}}announcement New staff member!", "MISSING_TEXT": "You must enter the announcement text!", "TOO_LONG": "Your text should be shorter than 1030 characters!", diff --git a/languages/en-US/moderation/ban.json b/languages/en-US/moderation/ban.json index 9b965f99f8..7d84f47fc8 100644 --- a/languages/en-US/moderation/ban.json +++ b/languages/en-US/moderation/ban.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Ban the mentioned member!", - "USAGE": "{{prefix}}ban [@user] (reason)", "EXAMPLES": "{{prefix}}ban @Androz#2091 Spam", "MISSING_MEMBER": "Please specify a valid member to ban!", "YOURSELF": "You can't sanction yourself!", diff --git a/languages/en-US/moderation/checkinvites.json b/languages/en-US/moderation/checkinvites.json index f19dec94c4..8cc00dc7ea 100644 --- a/languages/en-US/moderation/checkinvites.json +++ b/languages/en-US/moderation/checkinvites.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Check if members have a Discord server link in their status!", - "USAGE": "{{prefix}}checkinvites", "EXAMPLES": "{{prefix}}checkinvites", "NOBODY": "No member advertises in their status!" } diff --git a/languages/en-US/moderation/clear-sanctions.json b/languages/en-US/moderation/clear-sanctions.json index 1df99b4297..4c8a40930b 100644 --- a/languages/en-US/moderation/clear-sanctions.json +++ b/languages/en-US/moderation/clear-sanctions.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Clear a member sanctions!", - "USAGE": "{{prefix}}clear-sanctions [@member]", "EXAMPLES": "{{prefix}}clear-sanctions @Androz#2091", "MISSING_MEMBER": "Please mention the member you wish to remove the sanctions from!", "SUCCESS": "**{{username}}**'s sanctions were deleted!" diff --git a/languages/en-US/moderation/clear.json b/languages/en-US/moderation/clear.json index 20c92d8315..2f613fb18e 100644 --- a/languages/en-US/moderation/clear.json +++ b/languages/en-US/moderation/clear.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Quickly delete multiple messages!", - "USAGE": "{{prefix}}clear [number-of-messages] (@member)", "EXAMPLES": "{{prefix}}clear 10\n{{prefix}}clear 10 @Androz#2091", "MISSING_AMOUNT": "You must specify a number of messages to delete!", "ALL_CONFIRM": "All the channel messages will be deleted! To confirm type `-confirm`", diff --git a/languages/en-US/moderation/giveaway.json b/languages/en-US/moderation/giveaway.json index 62ef63c2b6..2cbc784e87 100644 --- a/languages/en-US/moderation/giveaway.json +++ b/languages/en-US/moderation/giveaway.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Easily manage your giveaways!", - "USAGE": "{{prefix}}giveaway [create/reroll/delete/end] (time) (winners count) (prize)", "EXAMPLES": "{{prefix}}giveaway create 10m 2 5$ PayPal!\n{{prefix}}giveaway reroll 597812898022031374", "MISSING_STATUS": "You must specify an action between `create`, `reroll`, `end` or `delete`!", "INVALID_CREATE": "You must enter the information like this: \n\n`{{prefix}}giveaway create [time] [winners count] [prize]`", diff --git a/languages/en-US/moderation/kick.json b/languages/en-US/moderation/kick.json index 0b28e70f3e..9ea3b86669 100644 --- a/languages/en-US/moderation/kick.json +++ b/languages/en-US/moderation/kick.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Kick the mentioned member!", - "USAGE": "{{prefix}}kick [@member] (reason)", "EXAMPLES": "{{prefix}}kick @Androz#2091 Spam", "MISSING_MEMBER": "Please specify a valid member to kick!", "MISSING_PERM": "An error has occurred... Please check that I have the permission to kick this specific member and try again!", diff --git a/languages/en-US/moderation/mute.json b/languages/en-US/moderation/mute.json index bc700f9938..23a0cff94d 100644 --- a/languages/en-US/moderation/mute.json +++ b/languages/en-US/moderation/mute.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Prevents a member from sending messages and connecting to a voice chat room for a defined period of time!", - "USAGE": "{{prefix}}mute [@member] [time]", "EXAMPLES": "{{prefix}}mute @Androz#2091 Spam", "MISSING_MEMBER": "Please specify a valid member to mute!", "MUTED_DM": "Hello {{username}},\nYou've just been muted on **{{server}}** by **{{moderator}}** for **{{time}}** because of **{{reason}}**!", diff --git a/languages/en-US/moderation/poll.json b/languages/en-US/moderation/poll.json index c90fb8456d..93a9cb5ed2 100644 --- a/languages/en-US/moderation/poll.json +++ b/languages/en-US/moderation/poll.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Launch a survey in the current channel!", - "USAGE": "{{prefix}}poll [question]", "EXAMPLES": "{{prefix}}poll Is the Earth flat?", "MISSING_QUESTION": "Please specify a question!", "REACT": "React with {{success}} or {{error}}!", diff --git a/languages/en-US/moderation/sanctions.json b/languages/en-US/moderation/sanctions.json index d1d5b0aa5b..13ec7b65c0 100644 --- a/languages/en-US/moderation/sanctions.json +++ b/languages/en-US/moderation/sanctions.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Displays the list of infractions committed by a member!", - "USAGE": "{{prefix}}sanctions [@member]", "EXAMPLES": "{{prefix}}sanctions @Androz#2091", "MISSING_MEMBER": "You must specify a member!", "NO_SANCTION": "**{{username}}** did not receive any sanctions." diff --git a/languages/en-US/moderation/setwarns.json b/languages/en-US/moderation/setwarns.json index 15d28ef33f..05073b0705 100644 --- a/languages/en-US/moderation/setwarns.json +++ b/languages/en-US/moderation/setwarns.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Define the sanctions that members will get after a certain number of warns!", - "USAGE": "{{prefix}}setwarns [kick/ban] [number/reset]", "EXAMPLES": "{{prefix}}setwarns kick 10\n{{prefix}}setwarns ban 10\n{{prefix}}setwarns ban reset", "MISSING_TYPE": "Please specify sanction between `kick` and `ban`", "SUCCESS_KICK": "** `{{count}}` warnings will result in an expulsion!**\n\n:arrow_right_hook: *Send `{{prefix}}configuration` to see the updated configuration!*", diff --git a/languages/en-US/moderation/unban.json b/languages/en-US/moderation/unban.json index 27097f4766..293ad692f7 100644 --- a/languages/en-US/moderation/unban.json +++ b/languages/en-US/moderation/unban.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Unban the user from the server!", - "USAGE": "{{prefix}}unban [userID/user#0000]", "EXAMPLES": "{{prefix}}unban 422820341791064085\n{{prefix}}unban Androz#2091", "MISSING_ID": "Please specify the ID of the member you wish to unban!", "NOT_BANNED": "**{{username}}** is not banned!", diff --git a/languages/en-US/moderation/unmute.json b/languages/en-US/moderation/unmute.json index 7e733f5662..a8e3c03dac 100644 --- a/languages/en-US/moderation/unmute.json +++ b/languages/en-US/moderation/unmute.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Unmute the mentioned member!", - "USAGE": "{{prefix}}unmute [@member]", "EXAMPLES": "{{prefix}}unmute @Androz#2091", "MISSING_MEMBER": "Please specify the member you want to unmute!", "NOT_MUTED": "**{{username}}** is not muted on this server!", diff --git a/languages/en-US/moderation/warn.json b/languages/en-US/moderation/warn.json index 3f8b150eed..651c3b7684 100644 --- a/languages/en-US/moderation/warn.json +++ b/languages/en-US/moderation/warn.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Warn a member in private messages", - "USAGE": "{{prefix}}warn [@member] [reason]", "EXAMPLES": "{{prefix}}warn @Androz#2091 Dumb", "MISSING_MEMBER": "Please specify the member you want to warn!", "MISSING_REASON": "Please enter a reason!", diff --git a/languages/en-US/music/autoplay.json b/languages/en-US/music/autoplay.json index 69b8517cd6..1885ab2837 100644 --- a/languages/en-US/music/autoplay.json +++ b/languages/en-US/music/autoplay.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Enable or disable the autoplay feature", - "USAGE": "{{prefix}}autoplay", "EXAMPLES": "{{prefix}}autoplay", "SUCCESS_ENABLED": "{{success}} Auto play is now enabled!", "SUCCESS_DISABLED": "{{success}} Auto play is now disabled!" diff --git a/languages/en-US/music/back.json b/languages/en-US/music/back.json index ab06741a8c..cf94c34077 100644 --- a/languages/en-US/music/back.json +++ b/languages/en-US/music/back.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Play back the previous song", - "USAGE": "{{prefix}}back", "EXAMPLES": "{{prefix}}back", "NO_PREV_SONG": "There was no song before this one!", "VOTE_CONTENT": "Previous song: {{songName}}\nReact with πŸ‘ to play the previous song! {{requiredCount}} more votes are required.", diff --git a/languages/en-US/music/filter.json b/languages/en-US/music/filter.json index 4152323fe9..03daa04361 100644 --- a/languages/en-US/music/filter.json +++ b/languages/en-US/music/filter.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Enable or disable a filter!", - "USAGE": "{{prefix}}filter [filter]", "EXAMPLES": "{{prefix}}filter vaporwave", "MISSING_FILTER": "Please specify a valid filter to enable or disable! (or send `{{prefix}}filters` to get the statuses of the filters)", "UNKNOWN_FILTER": "This filter doesn't exist! Send `{{prefix}}filters` to get the list!", diff --git a/languages/en-US/music/filters.json b/languages/en-US/music/filters.json index e71df3d3f7..776bd5f72b 100644 --- a/languages/en-US/music/filters.json +++ b/languages/en-US/music/filters.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Send the list of all the filters and their status", - "USAGE": "{{prefix}}filters", "EXAMPLES": "{{prefix}}filters", "TITLE": "**Filters**", "CONTENT": "Here is the list of all filters enabled or disabled.\nUse `{{prefix}}filter` to change the status of one of them." diff --git a/languages/en-US/music/lyrics.json b/languages/en-US/music/lyrics.json index 136680f501..7abe37a5d7 100644 --- a/languages/en-US/music/lyrics.json +++ b/languages/en-US/music/lyrics.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Shows the song lyrics", - "USAGE": "{{prefix}}lyrics [song-name]", "EXAMPLES": "{{prefix}}lyrics Skyfall", "LYRICS_OF": "🎀 {{songName}} lyrics", "AND_MORE": "\n**And more...**", diff --git a/languages/en-US/music/np.json b/languages/en-US/music/np.json index 66b6d7952e..c3b864437d 100644 --- a/languages/en-US/music/np.json +++ b/languages/en-US/music/np.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Shows information about the current song!", - "USAGE": "{{prefix}}np", "EXAMPLES": "{{prefix}}np", "CURRENTLY_PLAYING": "Currently playing", "T_TITLE": "Title", diff --git a/languages/en-US/music/pause.json b/languages/en-US/music/pause.json index e993ffe417..66a4eb0355 100644 --- a/languages/en-US/music/pause.json +++ b/languages/en-US/music/pause.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Pause the current song!", - "USAGE": "{{prefix}}pause", "EXAMPLES": "{{prefix}}pause", "SUCCESS": "⏸️ Music paused." } \ No newline at end of file diff --git a/languages/en-US/music/play.json b/languages/en-US/music/play.json index 49424b804e..fed651b25a 100644 --- a/languages/en-US/music/play.json +++ b/languages/en-US/music/play.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Plays music for you!", - "USAGE": "{{prefix}}play [song]", "EXAMPLES": "{{prefix}}play Bye Bye", "NO_VOICE_CHANNEL": "You must be connected to a voice channel!", "VOICE_CHANNEL_CONNECT": "I can't connect to your voice channel!", diff --git a/languages/en-US/music/queue.json b/languages/en-US/music/queue.json index e2a9c47a1b..d8b81878c4 100644 --- a/languages/en-US/music/queue.json +++ b/languages/en-US/music/queue.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Shows the server queue", - "USAGE": "{{prefix}}queue", "EXAMPLES": "{{prefix}}queue", "TITLE": "Server Queue" } \ No newline at end of file diff --git a/languages/en-US/music/resume.json b/languages/en-US/music/resume.json index 7a2868b957..24bb09f859 100644 --- a/languages/en-US/music/resume.json +++ b/languages/en-US/music/resume.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Resume the current song!", - "USAGE": "{{prefix}}resume", "EXAMPLES": "{{prefix}}resume", "SUCCESS": "▢️ Music resumed!" } \ No newline at end of file diff --git a/languages/en-US/music/seek.json b/languages/en-US/music/seek.json index f4eb505d44..2e0ee11977 100644 --- a/languages/en-US/music/seek.json +++ b/languages/en-US/music/seek.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Go forward or backward a specific amount of time in the current song!!", - "USAGE": "{{prefix}}seek [time]", "EXAMPLES": "{{prefix}}resume 10s", "INVALID_TIME": "You must specify a valid number of time!", "SUCCESS": "▢️ Music sought!" diff --git a/languages/en-US/music/skip.json b/languages/en-US/music/skip.json index f25234480a..d11f99c112 100644 --- a/languages/en-US/music/skip.json +++ b/languages/en-US/music/skip.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Skip the current song", - "USAGE": "{{prefix}}skip", "EXAMPLES": "{{prefix}}skip", "NO_NEXT_SONG": "There's no song after this one!", "VOTE_CONTENT": "Next song: {{songName}}\nReact with πŸ‘ to skip the music! {{requiredCount}} more votes are required.", diff --git a/languages/en-US/music/stop.json b/languages/en-US/music/stop.json index d60924c479..05e690b379 100644 --- a/languages/en-US/music/stop.json +++ b/languages/en-US/music/stop.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Stop the music", - "USAGE": "{{prefix}}stop", "EXAMPLES": "{{prefix}}stop", "VOTE_CONTENT": "React with πŸ‘ to stop the music! {{requiredCount}} more votes are required.", "SUCCESS": "Music stopped!" diff --git a/languages/en-US/owner/eval.json b/languages/en-US/owner/eval.json index 3c55b58c72..099a4a8b55 100644 --- a/languages/en-US/owner/eval.json +++ b/languages/en-US/owner/eval.json @@ -1,5 +1,4 @@ { "DESCRIPTION": "Executes the given code", - "USAGE": "{{prefix}}eval [code]", "EXAMPLES": "{{prefix}}eval message.author.send(message.client.token);" } \ No newline at end of file diff --git a/languages/en-US/owner/reload.json b/languages/en-US/owner/reload.json index c222fc7152..77692dd7e6 100644 --- a/languages/en-US/owner/reload.json +++ b/languages/en-US/owner/reload.json @@ -1,6 +1,5 @@ { "DESCRIPTION": "Reload a command!", - "USAGE": "{{prefix}}reload", "EXAMPLES": "{{prefix}}reload", "NOT_FOUND": "`{{search}}` is not an available command!", "SUCCESS": "Command successfully reloaded!" diff --git a/languages/en-US/owner/servers-list.json b/languages/en-US/owner/servers-list.json index 326ade3c14..5da7c4eb5f 100644 --- a/languages/en-US/owner/servers-list.json +++ b/languages/en-US/owner/servers-list.json @@ -1,5 +1,4 @@ { "DESCRIPTION": "Show the servers list!", - "USAGE": "{{prefix}}servers-list", "EXAMPLES": "{{prefix}}servers-list" } \ No newline at end of file diff --git a/package.json b/package.json index aeba0b3b7d..fd0f1e4b4e 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "dependencies": { "@discord-player/extractor": "^3.0.0", "@discordjs/opus": "^0.5.0", - "@k3rn31p4nic/google-translate-api": "github:k3rn31p4nic/google-translate-api", + "@iamtraction/google-translate": "^1.1.2", "@sentry/node": "6.3.6", "@sindresorhus/slugify": "^1.1.0", "amethyste-api": "github:Androz2091/amethyste-api", @@ -29,17 +29,18 @@ "blague.xyz": "^2.0.4", "btoa": "^1.2.1", "canvacord": "^5.1.0", - "canvas": "^2.6.1", + "canvas": "^2.8.0", "chalk": "^4.1.0", "colors-generator": "^0.3.4", "cron": "^1.7.2", "dblapi.js": "^2.3.0", - "discord-backup": "^2.1.19", + "discord-backup": "^3.0.1", "discord-canvas": "^1.3.2", "discord-giveaways": "^4.4.3", "discord-paginationembed": "^2.1.0", - "discord-player": "^4.1.0", - "discord.js": "discordjs/discord.js", + "discord-player": "^5.0.2", + "discord-sync-commands": "^0.2.0", + "discord.js": "^13.1.0", "ejs": "^3.1.3", "express": "^4.17.1", "express-session": "^1.17.0", @@ -94,6 +95,10 @@ "error", "always" ], + "eol-last": [ + "error", + "always" + ], "linebreak-style": 0, "require-atomic-updates": 0 } diff --git a/scripts/create-db-indexes.js b/scripts/create-db-indexes.js index d9b029b65f..b0942989e2 100644 --- a/scripts/create-db-indexes.js +++ b/scripts/create-db-indexes.js @@ -41,4 +41,4 @@ client.connect().then(async () => { }).catch(() => { console.log(chalk.red("Couldn't connect to mongoDB database...")); process.exit(1); -}); \ No newline at end of file +}); diff --git a/scripts/migrate-db-from-v4.6-to-v4.7.js b/scripts/migrate-db-from-v4.6-to-v4.7.js index 5a3be6a4ae..c59d3b4559 100644 --- a/scripts/migrate-db-from-v4.6-to-v4.7.js +++ b/scripts/migrate-db-from-v4.6-to-v4.7.js @@ -33,4 +33,4 @@ client.connect().then(async () => { }).catch(() => { console.log(chalk.red("Couldn't connect to mongoDB database...")); process.exit(1); -}); \ No newline at end of file +});