diff --git a/commands/!DISABLED/importmee6.js b/commands/!DISABLED/importmee6.js index 9003580a..4c19b79b 100644 --- a/commands/!DISABLED/importmee6.js +++ b/commands/!DISABLED/importmee6.js @@ -46,7 +46,7 @@ class ImportMee6 extends BaseCommand { content: interaction.translate("owner/debug:SUCCESS_LEVEL", { user: interaction.member.toString(), amount: level, - }, "success"), + }), }); } } diff --git a/commands/Administration/config.js b/commands/Administration/config.js index 3cf3474f..28a14bfa 100644 --- a/commands/Administration/config.js +++ b/commands/Administration/config.js @@ -207,7 +207,7 @@ async function changeSetting(interaction, setting, state, channel, guildData) { await guildData.save(); return interaction.reply({ - content: `${interaction.translate(`administration/config:${settingSplitted.length === 2 ? settingSplitted[1].toUpperCase() : setting.toUpperCase()}`, null, "success")}: **${interaction.translate("common:DISABLED", null, "success")}**`, + content: `${interaction.translate(`administration/config:${settingSplitted.length === 2 ? settingSplitted[1].toUpperCase() : setting.toUpperCase()}`)}: **${interaction.translate("common:DISABLED")}**`, ephemeral: true, }); } else { @@ -226,7 +226,7 @@ async function changeSetting(interaction, setting, state, channel, guildData) { } else return interaction.reply({ content: `${interaction.translate(`administration/config:${settingSplitted.length === 2 ? settingSplitted[1].toUpperCase() : setting.toUpperCase()}`)}: ${ - guildData.plugins[setting] ? `**${interaction.translate("common:ENABLED", null, "success")}** (<#${guildData.plugins[setting]}>)` : `**${interaction.translate("common:DISABLED", null, "success")}**` + guildData.plugins[setting] ? `**${interaction.translate("common:ENABLED")}** (<#${guildData.plugins[setting]}>)` : `**${interaction.translate("common:DISABLED")}**` }`, ephemeral: true, }); diff --git a/commands/Administration/selectroles.js b/commands/Administration/selectroles.js index c35159f4..cbaac01c 100644 --- a/commands/Administration/selectroles.js +++ b/commands/Administration/selectroles.js @@ -102,7 +102,7 @@ class Selectroles extends BaseCommand { } interaction.reply({ - content: interaction.translate("administration/selectroles:ROLES_UPDATED", null, "success"), + content: interaction.translate("administration/selectroles:ROLES_UPDATED"), ephemeral: true, }); } diff --git a/commands/Economy/marry.js b/commands/Economy/marry.js index 5f65d2f0..6eb6c8fe 100644 --- a/commands/Economy/marry.js +++ b/commands/Economy/marry.js @@ -167,7 +167,7 @@ class Marry extends BaseCommand { content: interaction.translate("economy/marry:SUCCESS", { creator: interaction.member.toString(), partner: member.toString(), - }, "success"), + }), components: [], }); } else return interaction.editReply({ diff --git a/commands/Music/loop.js b/commands/Music/loop.js index db98b05e..38957fca 100644 --- a/commands/Music/loop.js +++ b/commands/Music/loop.js @@ -59,11 +59,11 @@ class Loop extends BaseCommand { if (!queue) return interaction.error("music/play:NOT_PLAYING", null, { edit: true }); const translated = { - "AUTOPLAY": interaction.translate("music/loop:AUTOPLAY_ENABLED", null, "success"), - "QUEUE": interaction.translate("music/loop:QUEUE_ENABLED", null, "success"), - "TRACK": interaction.translate("music/loop:TRACK_ENABLED", null, "success"), - "OFF": interaction.translate("music/loop:LOOP_DISABLED", null, "success"), - "0": interaction.translate("music/loop:LOOP_DISABLED", null, "success"), + "AUTOPLAY": interaction.translate("music/loop:AUTOPLAY_ENABLED"), + "QUEUE": interaction.translate("music/loop:QUEUE_ENABLED"), + "TRACK": interaction.translate("music/loop:TRACK_ENABLED"), + "OFF": interaction.translate("music/loop:LOOP_DISABLED"), + "0": interaction.translate("music/loop:LOOP_DISABLED"), }; const type = interaction.options.getString("option"), diff --git a/commands/Music/nowplaying.js b/commands/Music/nowplaying.js index 8d9bd2c6..07abea59 100644 --- a/commands/Music/nowplaying.js +++ b/commands/Music/nowplaying.js @@ -56,7 +56,7 @@ class Nowplaying extends BaseCommand { queue.history.back(); - await interaction.followUp({ content: interaction.translate("music/back:SUCCESS", null, "success"), ephemeral: true }); + await interaction.followUp({ content: interaction.translate("music/back:SUCCESS"), ephemeral: true }); const embed = await updateEmbed(interaction, queue); @@ -94,11 +94,11 @@ class Nowplaying extends BaseCommand { collected = await msg.awaitMessageComponent({ filter, time: 10 * 1000 }), mode = QueueRepeatMode[collected.values[0]], translated = { - "AUTOPLAY": interaction.translate("music/loop:AUTOPLAY_ENABLED", null, "success"), - "QUEUE": interaction.translate("music/loop:QUEUE_ENABLED", null, "success"), - "TRACK": interaction.translate("music/loop:TRACK_ENABLED", null, "success"), - "OFF": interaction.translate("music/loop:LOOP_DISABLED", null, "success"), - "0": interaction.translate("music/loop:LOOP_DISABLED", null, "success"), + "AUTOPLAY": interaction.translate("music/loop:AUTOPLAY_ENABLED"), + "QUEUE": interaction.translate("music/loop:QUEUE_ENABLED"), + "TRACK": interaction.translate("music/loop:TRACK_ENABLED"), + "OFF": interaction.translate("music/loop:LOOP_DISABLED"), + "0": interaction.translate("music/loop:LOOP_DISABLED"), }; await collected.deferUpdate(); @@ -135,7 +135,7 @@ class Nowplaying extends BaseCommand { await interaction.followUp({ content: interaction.translate("music/play:ADDED_QUEUE", { songName: searchResult.hasPlaylist() ? searchResult.playlist.title : searchResult.tracks[0].title, - }, "success"), + }), }); const embed = await updateEmbed(interaction, queue); @@ -148,7 +148,7 @@ class Nowplaying extends BaseCommand { queue.node.skip(); - await interaction.followUp({ content: interaction.translate("music/skip:SUCCESS", null, "success"), ephemeral: true }); + await interaction.followUp({ content: interaction.translate("music/skip:SUCCESS"), ephemeral: true }); const embed = await updateEmbed(interaction, queue); diff --git a/commands/Music/play.c.js b/commands/Music/play.c.js index 0a06e76b..e8113f09 100644 --- a/commands/Music/play.c.js +++ b/commands/Music/play.c.js @@ -65,7 +65,7 @@ class PlayContext extends BaseCommand { interaction.editReply({ content: interaction.translate("music/play:ADDED_QUEUE", { songName: searchResult.hasPlaylist() ? searchResult.playlist.title : searchResult.tracks[0].title, - }, "success"), + }), }); if (client.player.nodes.get(interaction.guildId).currentTrack.url === query && query.match(/&t=[[0-9]+/g) !== null) { diff --git a/commands/Music/play.js b/commands/Music/play.js index aa6549d8..867e816c 100644 --- a/commands/Music/play.js +++ b/commands/Music/play.js @@ -80,7 +80,7 @@ class Play extends BaseCommand { interaction.editReply({ content: interaction.translate("music/play:ADDED_QUEUE", { songName: searchResult.hasPlaylist() ? searchResult.playlist.title : searchResult.tracks[0].title, - }, "success"), + }), }); // TODO: Seeks currently playing D: diff --git a/helpers/extenders.js b/helpers/extenders.js index 70b40c21..0c0068ad 100644 --- a/helpers/extenders.js +++ b/helpers/extenders.js @@ -4,11 +4,11 @@ User.prototype.getUsername = function () { return this.discriminator === "0" ? this.username : this.tag; }; -BaseInteraction.prototype.translate = function (key, args, emoji) { - const lang = this.client.translations.get(this.guild.data.language ?? "en-US"); - const string = emoji !== undefined ? `${this.client.customEmojis[emoji]} | ${lang(key, args)}` : lang(key, args); +BaseInteraction.prototype.translate = function (key, args) { + const language = this.client.translations.get(this.guild ? this.guild.data.language : "en-US"); + if (!language) throw "Interaction: Invalid language set in data."; - return string; + return language(key, args); }; BaseInteraction.prototype.replyT = function (key, args, options = {}) { @@ -31,11 +31,11 @@ BaseInteraction.prototype.error = function (key, args, options = {}) { return this.replyT(key, args, options); }; -Message.prototype.translate = function (key, args, emoji) { - const lang = this.client.translations.get(this.guild.data.language ?? "en-US"); - const string = emoji !== undefined ? `${this.client.customEmojis[emoji]} | ${lang(key, args)}` : lang(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 string; + return language(key, args); }; Message.prototype.replyT = function (key, args, options = {}) {