revert some changes

This commit is contained in:
Jonny_Bro (Nikita) 2023-11-04 23:06:51 +05:00
parent 6774804543
commit 8afc01f648
9 changed files with 28 additions and 28 deletions

View file

@ -46,7 +46,7 @@ class ImportMee6 extends BaseCommand {
content: interaction.translate("owner/debug:SUCCESS_LEVEL", { content: interaction.translate("owner/debug:SUCCESS_LEVEL", {
user: interaction.member.toString(), user: interaction.member.toString(),
amount: level, amount: level,
}, "success"), }),
}); });
} }
} }

View file

@ -207,7 +207,7 @@ async function changeSetting(interaction, setting, state, channel, guildData) {
await guildData.save(); await guildData.save();
return interaction.reply({ 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, ephemeral: true,
}); });
} else { } else {
@ -226,7 +226,7 @@ async function changeSetting(interaction, setting, state, channel, guildData) {
} else } else
return interaction.reply({ return interaction.reply({
content: `${interaction.translate(`administration/config:${settingSplitted.length === 2 ? settingSplitted[1].toUpperCase() : setting.toUpperCase()}`)}: ${ 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, ephemeral: true,
}); });

View file

@ -102,7 +102,7 @@ class Selectroles extends BaseCommand {
} }
interaction.reply({ interaction.reply({
content: interaction.translate("administration/selectroles:ROLES_UPDATED", null, "success"), content: interaction.translate("administration/selectroles:ROLES_UPDATED"),
ephemeral: true, ephemeral: true,
}); });
} }

View file

@ -167,7 +167,7 @@ class Marry extends BaseCommand {
content: interaction.translate("economy/marry:SUCCESS", { content: interaction.translate("economy/marry:SUCCESS", {
creator: interaction.member.toString(), creator: interaction.member.toString(),
partner: member.toString(), partner: member.toString(),
}, "success"), }),
components: [], components: [],
}); });
} else return interaction.editReply({ } else return interaction.editReply({

View file

@ -59,11 +59,11 @@ class Loop extends BaseCommand {
if (!queue) return interaction.error("music/play:NOT_PLAYING", null, { edit: true }); if (!queue) return interaction.error("music/play:NOT_PLAYING", null, { edit: true });
const translated = { const translated = {
"AUTOPLAY": interaction.translate("music/loop:AUTOPLAY_ENABLED", null, "success"), "AUTOPLAY": interaction.translate("music/loop:AUTOPLAY_ENABLED"),
"QUEUE": interaction.translate("music/loop:QUEUE_ENABLED", null, "success"), "QUEUE": interaction.translate("music/loop:QUEUE_ENABLED"),
"TRACK": interaction.translate("music/loop:TRACK_ENABLED", null, "success"), "TRACK": interaction.translate("music/loop:TRACK_ENABLED"),
"OFF": interaction.translate("music/loop:LOOP_DISABLED", null, "success"), "OFF": interaction.translate("music/loop:LOOP_DISABLED"),
"0": interaction.translate("music/loop:LOOP_DISABLED", null, "success"), "0": interaction.translate("music/loop:LOOP_DISABLED"),
}; };
const type = interaction.options.getString("option"), const type = interaction.options.getString("option"),

View file

@ -56,7 +56,7 @@ class Nowplaying extends BaseCommand {
queue.history.back(); 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); const embed = await updateEmbed(interaction, queue);
@ -94,11 +94,11 @@ class Nowplaying extends BaseCommand {
collected = await msg.awaitMessageComponent({ filter, time: 10 * 1000 }), collected = await msg.awaitMessageComponent({ filter, time: 10 * 1000 }),
mode = QueueRepeatMode[collected.values[0]], mode = QueueRepeatMode[collected.values[0]],
translated = { translated = {
"AUTOPLAY": interaction.translate("music/loop:AUTOPLAY_ENABLED", null, "success"), "AUTOPLAY": interaction.translate("music/loop:AUTOPLAY_ENABLED"),
"QUEUE": interaction.translate("music/loop:QUEUE_ENABLED", null, "success"), "QUEUE": interaction.translate("music/loop:QUEUE_ENABLED"),
"TRACK": interaction.translate("music/loop:TRACK_ENABLED", null, "success"), "TRACK": interaction.translate("music/loop:TRACK_ENABLED"),
"OFF": interaction.translate("music/loop:LOOP_DISABLED", null, "success"), "OFF": interaction.translate("music/loop:LOOP_DISABLED"),
"0": interaction.translate("music/loop:LOOP_DISABLED", null, "success"), "0": interaction.translate("music/loop:LOOP_DISABLED"),
}; };
await collected.deferUpdate(); await collected.deferUpdate();
@ -135,7 +135,7 @@ class Nowplaying extends BaseCommand {
await interaction.followUp({ await interaction.followUp({
content: interaction.translate("music/play:ADDED_QUEUE", { content: interaction.translate("music/play:ADDED_QUEUE", {
songName: searchResult.hasPlaylist() ? searchResult.playlist.title : searchResult.tracks[0].title, songName: searchResult.hasPlaylist() ? searchResult.playlist.title : searchResult.tracks[0].title,
}, "success"), }),
}); });
const embed = await updateEmbed(interaction, queue); const embed = await updateEmbed(interaction, queue);
@ -148,7 +148,7 @@ class Nowplaying extends BaseCommand {
queue.node.skip(); 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); const embed = await updateEmbed(interaction, queue);

View file

@ -65,7 +65,7 @@ class PlayContext extends BaseCommand {
interaction.editReply({ interaction.editReply({
content: interaction.translate("music/play:ADDED_QUEUE", { content: interaction.translate("music/play:ADDED_QUEUE", {
songName: searchResult.hasPlaylist() ? searchResult.playlist.title : searchResult.tracks[0].title, 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) { if (client.player.nodes.get(interaction.guildId).currentTrack.url === query && query.match(/&t=[[0-9]+/g) !== null) {

View file

@ -80,7 +80,7 @@ class Play extends BaseCommand {
interaction.editReply({ interaction.editReply({
content: interaction.translate("music/play:ADDED_QUEUE", { content: interaction.translate("music/play:ADDED_QUEUE", {
songName: searchResult.hasPlaylist() ? searchResult.playlist.title : searchResult.tracks[0].title, songName: searchResult.hasPlaylist() ? searchResult.playlist.title : searchResult.tracks[0].title,
}, "success"), }),
}); });
// TODO: Seeks currently playing D: // TODO: Seeks currently playing D:

View file

@ -4,11 +4,11 @@ User.prototype.getUsername = function () {
return this.discriminator === "0" ? this.username : this.tag; return this.discriminator === "0" ? this.username : this.tag;
}; };
BaseInteraction.prototype.translate = function (key, args, emoji) { BaseInteraction.prototype.translate = function (key, args) {
const lang = this.client.translations.get(this.guild.data.language ?? "en-US"); const language = this.client.translations.get(this.guild ? this.guild.data.language : "en-US");
const string = emoji !== undefined ? `${this.client.customEmojis[emoji]} | ${lang(key, args)}` : lang(key, args); if (!language) throw "Interaction: Invalid language set in data.";
return string; return language(key, args);
}; };
BaseInteraction.prototype.replyT = function (key, args, options = {}) { BaseInteraction.prototype.replyT = function (key, args, options = {}) {
@ -31,11 +31,11 @@ BaseInteraction.prototype.error = function (key, args, options = {}) {
return this.replyT(key, args, options); return this.replyT(key, args, options);
}; };
Message.prototype.translate = function (key, args, emoji) { Message.prototype.translate = function (key, args) {
const lang = this.client.translations.get(this.guild.data.language ?? "en-US"); const language = this.client.translations.get(this.guild ? this.guild.data.language : "en-US");
const string = emoji !== undefined ? `${this.client.customEmojis[emoji]} | ${lang(key, args)}` : lang(key, args); if (!language) throw "Message: Invalid language set in data.";
return string; return language(key, args);
}; };
Message.prototype.replyT = function (key, args, options = {}) { Message.prototype.replyT = function (key, args, options = {}) {