From 038ca3917efb2b33c5b12e88c66daa22a7cf2dd7 Mon Sep 17 00:00:00 2001 From: RainyXeon / Date: Thu, 28 Dec 2023 11:29:48 +0700 Subject: [PATCH 01/28] 4.1.1 pathc version --- src/commands/prefix/Music/Forward.ts | 87 +++++-------------- src/commands/prefix/Music/Play.ts | 3 +- src/commands/prefix/Music/Rewind.ts | 92 +++++--------------- src/commands/prefix/{Music => Utils}/247.ts | 2 +- src/commands/slash/Music/Forward.ts | 82 +++++------------- src/commands/slash/Music/Rewind.ts | 96 +++++---------------- src/commands/slash/{Music => Utils}/247.ts | 2 +- src/manifest.xml | 4 +- 8 files changed, 86 insertions(+), 282 deletions(-) rename src/commands/prefix/{Music => Utils}/247.ts (99%) rename src/commands/slash/{Music => Utils}/247.ts (99%) diff --git a/src/commands/prefix/Music/Forward.ts b/src/commands/prefix/Music/Forward.ts index 85573c18..bea25687 100644 --- a/src/commands/prefix/Music/Forward.ts +++ b/src/commands/prefix/Music/Forward.ts @@ -7,9 +7,9 @@ const fastForwardNum = 10; // Main code export default class implements PrefixCommand { name = "forward"; - description = "Forward timestamp in the song!"; + description = "Forward timestamp in the song! (10s)"; category = "Music"; - usage = ""; + usage = ""; aliases = []; lavalink = true; accessableby = Accessableby.Member; @@ -21,8 +21,6 @@ export default class implements PrefixCommand { language: string, prefix: string ) { - const value = args[0]; - const msg = await message.reply({ embeds: [ new EmbedBuilder() @@ -61,80 +59,35 @@ export default class implements PrefixCommand { const song = player.queue.current; const song_position = player.shoukaku.position; - const CurrentDuration = new FormatDuration().parse(song_position); + const CurrentDuration = new FormatDuration().parse(song_position + fastForwardNum * 1000); - if (value && !isNaN(+value)) { - if (song_position + Number(value) * 1000 < song!.length!) { - player.send({ - guildId: message.guild!.id, - playerOptions: { - position: song_position + Number(value) * 1000, - }, - }); + if (song_position + fastForwardNum * 1000 < song!.length!) { + player.send({ + guildId: message.guild!.id, + playerOptions: { + position: song_position + fastForwardNum * 1000, + }, + }); - const forward1 = new EmbedBuilder() - .setDescription( - `${client.i18n.get(language, "music", "forward_msg", { - duration: CurrentDuration, - })}` - ) - .setColor(client.color); + const forward2 = new EmbedBuilder() + .setDescription( + `${client.i18n.get(language, "music", "forward_msg", { + duration: CurrentDuration, + })}` + ) + .setColor(client.color); - msg.edit({ content: " ", embeds: [forward1] }); - } else { - return msg.edit({ - embeds: [ - new EmbedBuilder() - .setDescription( - `${client.i18n.get(language, "music", "forward_beyond")}` - ) - .setColor(client.color), - ], - }); - } - } else if (value && isNaN(+value)) { + msg.edit({ content: " ", embeds: [forward2] }); + } else { return msg.edit({ embeds: [ new EmbedBuilder() .setDescription( - `${client.i18n.get(language, "music", "forward_invalid", { - prefix: prefix, - })}` + `${client.i18n.get(language, "music", "forward_beyond")}` ) .setColor(client.color), ], }); } - - if (!value) { - if (song_position + fastForwardNum * 1000 < song!.length!) { - player["send"]({ - guildId: message.guild!.id, - playerOptions: { - position: song_position + fastForwardNum * 1000, - }, - }); - - const forward2 = new EmbedBuilder() - .setDescription( - `${client.i18n.get(language, "music", "forward_msg", { - duration: CurrentDuration, - })}` - ) - .setColor(client.color); - - msg.edit({ content: " ", embeds: [forward2] }); - } else { - return msg.edit({ - embeds: [ - new EmbedBuilder() - .setDescription( - `${client.i18n.get(language, "music", "forward_beyond")}` - ) - .setColor(client.color), - ], - }); - } - } } } diff --git a/src/commands/prefix/Music/Play.ts b/src/commands/prefix/Music/Play.ts index 355acd47..f8aae0b8 100644 --- a/src/commands/prefix/Music/Play.ts +++ b/src/commands/prefix/Music/Play.ts @@ -37,8 +37,7 @@ export default class implements PrefixCommand { const { channel } = message.member!.voice; if ( - !channel || - message.member!.voice.channel !== message.guild!.members.me!.voice.channel + !channel ) return msg.edit({ embeds: [ diff --git a/src/commands/prefix/Music/Rewind.ts b/src/commands/prefix/Music/Rewind.ts index 7a50c67a..3e498630 100644 --- a/src/commands/prefix/Music/Rewind.ts +++ b/src/commands/prefix/Music/Rewind.ts @@ -7,9 +7,9 @@ const rewindNum = 10; // Main code export default class implements PrefixCommand { name = "rewind"; - description = "Rewind timestamp in the song!"; + description = "Rewind timestamp in the song! (10s)"; category = "Music"; - usage = ""; + usage = ""; aliases = []; lavalink = true; accessableby = Accessableby.Member; @@ -30,13 +30,6 @@ export default class implements PrefixCommand { .setColor(client.color), ], }); - const value = args[0]; - - if (value && isNaN(+value)) - return msg.edit( - `${client.i18n.get(language, "music", "number_invalid")}` - ); - const player = client.manager.players.get(message.guild!.id); if (!player) return msg.edit({ @@ -64,80 +57,35 @@ export default class implements PrefixCommand { }); const song_position = player.shoukaku.position; - const CurrentDuration = new FormatDuration().parse(song_position); + const CurrentDuration = new FormatDuration().parse(song_position - rewindNum * 1000); - if (value && !isNaN(+value)) { - if (song_position - Number(value) * 1000 > 0) { - await player["send"]({ - guildId: message.guild!.id, - playerOptions: { - position: song_position - Number(value) * 1000, - }, - }); + if (song_position - rewindNum * 1000 > 0) { + await player["send"]({ + guildId: message.guild!.id, + playerOptions: { + position: song_position - rewindNum * 1000, + }, + }); - const rewind1 = new EmbedBuilder() - .setDescription( - `${client.i18n.get(language, "music", "rewind_msg", { - duration: CurrentDuration, - })}` - ) - .setColor(client.color); + const rewind2 = new EmbedBuilder() + .setDescription( + `${client.i18n.get(language, "music", "rewind_msg", { + duration: CurrentDuration, + })}` + ) + .setColor(client.color); - msg.edit({ content: " ", embeds: [rewind1] }); - } else { - return msg.edit({ - embeds: [ - new EmbedBuilder() - .setDescription( - `${client.i18n.get(language, "music", "rewind_beyond")}` - ) - .setColor(client.color), - ], - }); - } - } else if (value && isNaN(+value)) { + msg.edit({ content: " ", embeds: [rewind2] }); + } else { return msg.edit({ embeds: [ new EmbedBuilder() .setDescription( - `${client.i18n.get(language, "music", "rewind_invalid", { - prefix: prefix, - })}` + `${client.i18n.get(language, "music", "rewind_beyond")}` ) .setColor(client.color), ], }); } - - if (!value) { - if (song_position - rewindNum * 1000 > 0) { - await player["send"]({ - guildId: message.guild!.id, - playerOptions: { - position: song_position - rewindNum * 1000, - }, - }); - - const rewind2 = new EmbedBuilder() - .setDescription( - `${client.i18n.get(language, "music", "rewind_msg", { - duration: CurrentDuration, - })}` - ) - .setColor(client.color); - - msg.edit({ content: " ", embeds: [rewind2] }); - } else { - return msg.edit({ - embeds: [ - new EmbedBuilder() - .setDescription( - `${client.i18n.get(language, "music", "rewind_beyond")}` - ) - .setColor(client.color), - ], - }); - } - } } } diff --git a/src/commands/prefix/Music/247.ts b/src/commands/prefix/Utils/247.ts similarity index 99% rename from src/commands/prefix/Music/247.ts rename to src/commands/prefix/Utils/247.ts index def1a41f..fd8e470d 100644 --- a/src/commands/prefix/Music/247.ts +++ b/src/commands/prefix/Utils/247.ts @@ -7,7 +7,7 @@ import { AutoReconnectBuilder } from "../../../database/build/AutoReconnect.js"; export default class implements PrefixCommand { name = "247"; description = "24/7 in voice channel"; - category = "Music"; + category = "Utils"; usage = " or "; aliases = []; accessableby = Accessableby.Member; diff --git a/src/commands/slash/Music/Forward.ts b/src/commands/slash/Music/Forward.ts index 2f541bf5..98839280 100644 --- a/src/commands/slash/Music/Forward.ts +++ b/src/commands/slash/Music/Forward.ts @@ -13,27 +13,17 @@ const fastForwardNum = 10; // Main code export default class implements SlashCommand { name = ["forward"]; - description = "Forward timestamp in the song!"; + description = "Forward timestamp in the song! (10s)"; category = "Music"; accessableby = Accessableby.Member; lavalink = true; - options = [ - { - name: "seconds", - description: "The number of seconds to forward the timestamp by.", - type: ApplicationCommandOptionType.Number, - required: false, - }, - ]; + options = []; async run( interaction: CommandInteraction, client: Manager, language: string ) { await interaction.deferReply({ ephemeral: false }); - const value = ( - interaction.options as CommandInteractionOptionResolver - ).getNumber("seconds"); const msg = await interaction.editReply({ embeds: [ new EmbedBuilder() @@ -73,62 +63,30 @@ export default class implements SlashCommand { const song = player.queue.current; const song_position = player.shoukaku.position; - const CurrentDuration = new FormatDuration().parse(song_position); + const CurrentDuration = new FormatDuration().parse(song_position + fastForwardNum * 1000); - if (value && !isNaN(value)) { - if (song_position + value * 1000 < song!.length!) { - player.send({ - guildId: String(interaction.guild?.id), - playerOptions: { - position: song_position + value * 1000, - }, - }); + if (song_position + fastForwardNum * 1000 < song!.length!) { + player.send({ + guildId: String(interaction.guild?.id), + playerOptions: { + position: song_position + fastForwardNum * 1000, + }, + }); - const forward1 = new EmbedBuilder() - .setDescription( - `${client.i18n.get(language, "music", "forward_msg", { - duration: CurrentDuration, - })}` - ) - .setColor(client.color); + const forward2 = new EmbedBuilder() + .setDescription( + `${client.i18n.get(language, "music", "forward_msg", { + duration: CurrentDuration, + })}` + ) + .setColor(client.color); - msg.edit({ content: " ", embeds: [forward1] }); - } else { - return msg.edit( - `${client.i18n.get(language, "music", "forward_beyond")}` - ); - } - } else if (value && isNaN(value)) { + msg.edit({ content: " ", embeds: [forward2] }); + } else { return msg.edit( - `${client.i18n.get(language, "music", "forward_invalid", { - prefix: "/", - })}` + `${client.i18n.get(language, "music", "forward_beyond")}` ); } - if (!value) { - if (song_position + fastForwardNum * 1000 < song!.length!) { - player.send({ - guildId: String(interaction.guild?.id), - playerOptions: { - position: song_position + fastForwardNum * 1000, - }, - }); - - const forward2 = new EmbedBuilder() - .setDescription( - `${client.i18n.get(language, "music", "forward_msg", { - duration: CurrentDuration, - })}` - ) - .setColor(client.color); - - msg.edit({ content: " ", embeds: [forward2] }); - } else { - return msg.edit( - `${client.i18n.get(language, "music", "forward_beyond")}` - ); - } - } } } diff --git a/src/commands/slash/Music/Rewind.ts b/src/commands/slash/Music/Rewind.ts index c43d7465..3a00c01b 100644 --- a/src/commands/slash/Music/Rewind.ts +++ b/src/commands/slash/Music/Rewind.ts @@ -13,27 +13,18 @@ const rewindNum = 10; // Main code export default class implements SlashCommand { name = ["rewind"]; - description = "Rewind timestamp in the song!"; + description = "Rewind timestamp in the song! (10s)"; category = "Music"; lavalink = true; accessableby = Accessableby.Member; - options = [ - { - name: "seconds", - description: "Rewind timestamp in the song!", - type: ApplicationCommandOptionType.Number, - required: false, - }, - ]; + options = []; + async run( interaction: CommandInteraction, client: Manager, language: string ) { await interaction.deferReply({ ephemeral: false }); - const value = ( - interaction.options as CommandInteractionOptionResolver - ).getNumber("seconds"); const msg = await interaction.editReply({ embeds: [ @@ -73,80 +64,35 @@ export default class implements SlashCommand { }); const song_position = player.shoukaku.position; - const CurrentDuration = new FormatDuration().parse(song_position); + const CurrentDuration = new FormatDuration().parse(song_position - rewindNum * 1000); - if (value && !isNaN(value)) { - if (song_position - value * 1000 > 0) { - await player.send({ - guildId: interaction.guild!.id, - playerOptions: { - position: song_position - value * 1000, - }, - }); + if (song_position - rewindNum * 1000 > 0) { + await player.send({ + guildId: interaction.guild!.id, + playerOptions: { + position: song_position - rewindNum * 1000, + }, + }); - const rewind1 = new EmbedBuilder() - .setDescription( - `${client.i18n.get(language, "music", "rewind_msg", { - duration: CurrentDuration, - })}` - ) - .setColor(client.color); + const rewind2 = new EmbedBuilder() + .setDescription( + `${client.i18n.get(language, "music", "rewind_msg", { + duration: CurrentDuration, + })}` + ) + .setColor(client.color); - msg.edit({ content: " ", embeds: [rewind1] }); - } else { - return msg.edit({ - embeds: [ - new EmbedBuilder() - .setDescription( - `${client.i18n.get(language, "music", "rewind_beyond")}` - ) - .setColor(client.color), - ], - }); - } - } else if (value && isNaN(value)) { + msg.edit({ content: " ", embeds: [rewind2] }); + } else { return msg.edit({ embeds: [ new EmbedBuilder() .setDescription( - `${client.i18n.get(language, "music", "rewind_invalid", { - prefix: "/", - })}` + `${client.i18n.get(language, "music", "rewind_beyond")}` ) .setColor(client.color), ], }); } - - if (!value) { - if (song_position - rewindNum * 1000 > 0) { - await player.send({ - guildId: interaction.guild!.id, - playerOptions: { - position: song_position - rewindNum * 1000, - }, - }); - - const rewind2 = new EmbedBuilder() - .setDescription( - `${client.i18n.get(language, "music", "rewind_msg", { - duration: CurrentDuration, - })}` - ) - .setColor(client.color); - - msg.edit({ content: " ", embeds: [rewind2] }); - } else { - return msg.edit({ - embeds: [ - new EmbedBuilder() - .setDescription( - `${client.i18n.get(language, "music", "rewind_beyond")}` - ) - .setColor(client.color), - ], - }); - } - } } } diff --git a/src/commands/slash/Music/247.ts b/src/commands/slash/Utils/247.ts similarity index 99% rename from src/commands/slash/Music/247.ts rename to src/commands/slash/Utils/247.ts index c1abb39b..77c9b5c1 100644 --- a/src/commands/slash/Music/247.ts +++ b/src/commands/slash/Utils/247.ts @@ -12,7 +12,7 @@ import { AutoReconnectBuilder } from "../../../database/build/AutoReconnect.js"; export default class implements SlashCommand { name = ["247"]; description = "24/7 in voice channel"; - category = "Music"; + category = "Utils"; accessableby = Accessableby.Member; lavalink = true; options = [ diff --git a/src/manifest.xml b/src/manifest.xml index 92cd753f..033b7e22 100644 --- a/src/manifest.xml +++ b/src/manifest.xml @@ -7,8 +7,8 @@ - 4.1.0 - 4.1.1 + 4.1.1 + 4.2.0 hatsuharu (AzurLane) \ No newline at end of file From 012ade9304f872ea0445214ea0165c4ed7ca5ff1 Mon Sep 17 00:00:00 2001 From: RainyXeon / Date: Thu, 28 Dec 2023 18:22:16 +0700 Subject: [PATCH 02/28] Auto pause when leave --- .../prefix/Music/{Clear.ts => ClearQueue.ts} | 4 +- src/commands/prefix/Music/Forward.ts | 4 +- src/commands/prefix/Music/Join.ts | 2 +- src/commands/prefix/Music/Loop.ts | 4 +- .../prefix/Music/{LoopQueue.ts => LoopAll.ts} | 0 src/commands/prefix/Music/Play.ts | 4 +- src/commands/prefix/Music/Rewind.ts | 4 +- src/commands/prefix/Utils/247.ts | 28 +-- .../slash/Music/{Clear.ts => ClearQueue.ts} | 2 +- src/commands/slash/Music/Forward.ts | 5 +- src/commands/slash/Music/Loop.ts | 6 +- src/commands/slash/Music/LoopQueue.ts | 88 -------- src/commands/slash/Music/Rewind.ts | 4 +- src/commands/slash/Utils/247.ts | 23 +- src/events/guild/voiceStateUpdate.ts | 28 +++ src/languages/en/player.yaml | 12 +- src/languages/th/filters.yaml | 41 ---- src/languages/th/help.yaml | 14 -- src/languages/th/info.yaml | 9 - src/languages/th/interaction.yaml | 13 -- src/languages/th/music.yaml | 203 ------------------ src/languages/th/noplayer.yaml | 9 - src/languages/th/nopremium.yaml | 5 - src/languages/th/player.yaml | 62 ------ src/languages/th/playlist.yaml | 128 ----------- src/languages/th/premium.yaml | 22 -- src/languages/th/radio.yaml | 2 - src/languages/th/setup.yaml | 26 --- src/languages/th/utilities.yaml | 27 --- src/languages/vi/player.yaml | 10 +- src/manifest.xml | 2 +- 31 files changed, 84 insertions(+), 707 deletions(-) rename src/commands/prefix/Music/{Clear.ts => ClearQueue.ts} (97%) rename src/commands/prefix/Music/{LoopQueue.ts => LoopAll.ts} (100%) rename src/commands/slash/Music/{Clear.ts => ClearQueue.ts} (98%) delete mode 100644 src/commands/slash/Music/LoopQueue.ts delete mode 100644 src/languages/th/filters.yaml delete mode 100644 src/languages/th/help.yaml delete mode 100644 src/languages/th/info.yaml delete mode 100644 src/languages/th/interaction.yaml delete mode 100644 src/languages/th/music.yaml delete mode 100644 src/languages/th/noplayer.yaml delete mode 100644 src/languages/th/nopremium.yaml delete mode 100644 src/languages/th/player.yaml delete mode 100644 src/languages/th/playlist.yaml delete mode 100644 src/languages/th/premium.yaml delete mode 100644 src/languages/th/radio.yaml delete mode 100644 src/languages/th/setup.yaml delete mode 100644 src/languages/th/utilities.yaml diff --git a/src/commands/prefix/Music/Clear.ts b/src/commands/prefix/Music/ClearQueue.ts similarity index 97% rename from src/commands/prefix/Music/Clear.ts rename to src/commands/prefix/Music/ClearQueue.ts index 3f7bc8e9..8f712e8b 100644 --- a/src/commands/prefix/Music/Clear.ts +++ b/src/commands/prefix/Music/ClearQueue.ts @@ -4,11 +4,11 @@ import { EmbedBuilder, Message } from "discord.js"; // Main code export default class implements PrefixCommand { - name = "clear"; + name = "clearqueue"; description = "Clear song in queue!"; category = "Music"; usage = ""; - aliases = []; + aliases = ["clear", "cq"]; accessableby = Accessableby.Member; lavalink = true; diff --git a/src/commands/prefix/Music/Forward.ts b/src/commands/prefix/Music/Forward.ts index bea25687..14d9bf4f 100644 --- a/src/commands/prefix/Music/Forward.ts +++ b/src/commands/prefix/Music/Forward.ts @@ -59,7 +59,9 @@ export default class implements PrefixCommand { const song = player.queue.current; const song_position = player.shoukaku.position; - const CurrentDuration = new FormatDuration().parse(song_position + fastForwardNum * 1000); + const CurrentDuration = new FormatDuration().parse( + song_position + fastForwardNum * 1000 + ); if (song_position + fastForwardNum * 1000 < song!.length!) { player.send({ diff --git a/src/commands/prefix/Music/Join.ts b/src/commands/prefix/Music/Join.ts index 2758d9e9..0f311507 100644 --- a/src/commands/prefix/Music/Join.ts +++ b/src/commands/prefix/Music/Join.ts @@ -8,7 +8,7 @@ export default class implements PrefixCommand { description = "Make the bot join the voice channel."; category = "Music"; usage = ""; - aliases = []; + aliases = ["j"]; lavalink = true; accessableby = Accessableby.Member; diff --git a/src/commands/prefix/Music/Loop.ts b/src/commands/prefix/Music/Loop.ts index b6e913a5..8cea9f6f 100644 --- a/src/commands/prefix/Music/Loop.ts +++ b/src/commands/prefix/Music/Loop.ts @@ -57,7 +57,7 @@ export default class implements PrefixCommand { ], }); - const mode_array = ["none", "track", "queue"]; + const mode_array = ["none", "song", "queue"]; const mode = args[0]; @@ -68,7 +68,7 @@ export default class implements PrefixCommand { })}` ); - if (mode == "track") { + if (mode == "song") { await player.setLoop(KazagumoLoop.track); this.setLoop247(client, player, String(KazagumoLoop.track)); diff --git a/src/commands/prefix/Music/LoopQueue.ts b/src/commands/prefix/Music/LoopAll.ts similarity index 100% rename from src/commands/prefix/Music/LoopQueue.ts rename to src/commands/prefix/Music/LoopAll.ts diff --git a/src/commands/prefix/Music/Play.ts b/src/commands/prefix/Music/Play.ts index f8aae0b8..ec68b630 100644 --- a/src/commands/prefix/Music/Play.ts +++ b/src/commands/prefix/Music/Play.ts @@ -36,9 +36,7 @@ export default class implements PrefixCommand { }); const { channel } = message.member!.voice; - if ( - !channel - ) + if (!channel) return msg.edit({ embeds: [ new EmbedBuilder() diff --git a/src/commands/prefix/Music/Rewind.ts b/src/commands/prefix/Music/Rewind.ts index 3e498630..452047d7 100644 --- a/src/commands/prefix/Music/Rewind.ts +++ b/src/commands/prefix/Music/Rewind.ts @@ -57,7 +57,9 @@ export default class implements PrefixCommand { }); const song_position = player.shoukaku.position; - const CurrentDuration = new FormatDuration().parse(song_position - rewindNum * 1000); + const CurrentDuration = new FormatDuration().parse( + song_position - rewindNum * 1000 + ); if (song_position - rewindNum * 1000 > 0) { await player["send"]({ diff --git a/src/commands/prefix/Utils/247.ts b/src/commands/prefix/Utils/247.ts index fd8e470d..0b6325a0 100644 --- a/src/commands/prefix/Utils/247.ts +++ b/src/commands/prefix/Utils/247.ts @@ -41,11 +41,13 @@ export default class implements PrefixCommand { if (value == "disable") { if (!data.twentyfourseven) { const offAl = new EmbedBuilder() - .setDescription(`${client.i18n.get(language, "music", "247_off_already")}`) + .setDescription( + `${client.i18n.get(language, "music", "247_off_already")}` + ) .setColor(client.color); return msg.edit({ content: " ", embeds: [offAl] }); } - + data.current || data.current.length !== 0 ? await client.db.autoreconnect.set( `${message.guild!.id}.twentyfourseven`, @@ -63,10 +65,7 @@ export default class implements PrefixCommand { msg.edit({ content: " ", embeds: [on] }); } else if (value == "enable") { const { channel } = message.member!.voice; - if ( - !channel || - message.member!.voice.channel == null - ) + if (!channel || message.member!.voice.channel == null) return msg.edit({ embeds: [ new EmbedBuilder() @@ -79,17 +78,20 @@ export default class implements PrefixCommand { if (data.twentyfourseven) { const onAl = new EmbedBuilder() - .setDescription(`${client.i18n.get(language, "music", "247_on_already")}`) + .setDescription( + `${client.i18n.get(language, "music", "247_on_already")}` + ) .setColor(client.color); return msg.edit({ content: " ", embeds: [onAl] }); } - if (!player) await client.manager.createPlayer({ - guildId: message.guild!.id, - voiceId: message.member!.voice.channel!.id, - textId: message.channel.id, - deaf: true, - }) + if (!player) + await client.manager.createPlayer({ + guildId: message.guild!.id, + voiceId: message.member!.voice.channel!.id, + textId: message.channel.id, + deaf: true, + }); await client.db.autoreconnect.set( `${message.guild!.id}.twentyfourseven`, diff --git a/src/commands/slash/Music/Clear.ts b/src/commands/slash/Music/ClearQueue.ts similarity index 98% rename from src/commands/slash/Music/Clear.ts rename to src/commands/slash/Music/ClearQueue.ts index e878d99a..6f3152fa 100644 --- a/src/commands/slash/Music/Clear.ts +++ b/src/commands/slash/Music/ClearQueue.ts @@ -4,7 +4,7 @@ import { Accessableby, SlashCommand } from "../../../@types/Command.js"; // Main code export default class implements SlashCommand { - name = ["clear"]; + name = ["clearqueue"]; description = "Clear song in queue!"; category = "Music"; accessableby = Accessableby.Member; diff --git a/src/commands/slash/Music/Forward.ts b/src/commands/slash/Music/Forward.ts index 98839280..f9f299d0 100644 --- a/src/commands/slash/Music/Forward.ts +++ b/src/commands/slash/Music/Forward.ts @@ -63,7 +63,9 @@ export default class implements SlashCommand { const song = player.queue.current; const song_position = player.shoukaku.position; - const CurrentDuration = new FormatDuration().parse(song_position + fastForwardNum * 1000); + const CurrentDuration = new FormatDuration().parse( + song_position + fastForwardNum * 1000 + ); if (song_position + fastForwardNum * 1000 < song!.length!) { player.send({ @@ -87,6 +89,5 @@ export default class implements SlashCommand { `${client.i18n.get(language, "music", "forward_beyond")}` ); } - } } diff --git a/src/commands/slash/Music/Loop.ts b/src/commands/slash/Music/Loop.ts index bec80973..3f1d56f7 100644 --- a/src/commands/slash/Music/Loop.ts +++ b/src/commands/slash/Music/Loop.ts @@ -25,8 +25,8 @@ export default class implements SlashCommand { required: true, choices: [ { - name: "Current", - value: "current", + name: "Song", + value: "song", }, { name: "Queue", @@ -87,7 +87,7 @@ export default class implements SlashCommand { "type" )!.value; - if (mode == "current") { + if (mode == "song") { await player.setLoop(KazagumoLoop.track); this.setLoop247(client, player, String(KazagumoLoop.track)); const looped = new EmbedBuilder() diff --git a/src/commands/slash/Music/LoopQueue.ts b/src/commands/slash/Music/LoopQueue.ts deleted file mode 100644 index e61872e3..00000000 --- a/src/commands/slash/Music/LoopQueue.ts +++ /dev/null @@ -1,88 +0,0 @@ -import { EmbedBuilder, CommandInteraction, GuildMember } from "discord.js"; -import { Manager } from "../../../manager.js"; -import { Accessableby, SlashCommand } from "../../../@types/Command.js"; -import { KazagumoPlayer } from "kazagumo.mod"; -import { KazagumoLoop } from "../../../@types/Lavalink.js"; -import { AutoReconnectBuilder } from "../../../database/build/AutoReconnect.js"; - -// Main code -export default class implements SlashCommand { - name = ["loopall"]; - description = "Loop all songs in queue!"; - category = "Music"; - accessableby = Accessableby.Member; - lavalink = true; - options = []; - - async run( - interaction: CommandInteraction, - client: Manager, - language: string - ) { - await interaction.deferReply({ ephemeral: false }); - const msg = await interaction.editReply({ - embeds: [ - new EmbedBuilder() - .setDescription( - `${client.i18n.get(language, "music", "loopall_loading")}` - ) - .setColor(client.color), - ], - }); - - const player = client.manager.players.get(interaction.guild!.id); - if (!player) - return msg.edit({ - embeds: [ - new EmbedBuilder() - .setDescription( - `${client.i18n.get(language, "noplayer", "no_player")}` - ) - .setColor(client.color), - ], - }); - const { channel } = (interaction.member as GuildMember)!.voice; - if ( - !channel || - (interaction.member as GuildMember)!.voice.channel !== - interaction.guild!.members.me!.voice.channel - ) - return msg.edit({ - embeds: [ - new EmbedBuilder() - .setDescription( - `${client.i18n.get(language, "noplayer", "no_voice")}` - ) - .setColor(client.color), - ], - }); - if (player.loop === "queue") { - await player.setLoop(KazagumoLoop.none); - this.setLoop247(client, player, String(KazagumoLoop.none)); - - const unloopall = new EmbedBuilder() - .setDescription(`${client.i18n.get(language, "music", "unloopall")}`) - .setColor(client.color); - - return msg.edit({ content: " ", embeds: [unloopall] }); - } else if (player.loop === "none") { - await player.setLoop(KazagumoLoop.queue); - this.setLoop247(client, player, String(KazagumoLoop.queue)); - - const loopall = new EmbedBuilder() - .setDescription(`${client.i18n.get(language, "music", "loopall")}`) - .setColor(client.color); - - return msg.edit({ content: " ", embeds: [loopall] }); - } - } - - async setLoop247(client: Manager, player: KazagumoPlayer, loop: string) { - const check = await new AutoReconnectBuilder(client, player).execute( - player.guildId - ); - if (check) { - await client.db.autoreconnect.set(`${player.guildId}.config.loop`, loop); - } - } -} diff --git a/src/commands/slash/Music/Rewind.ts b/src/commands/slash/Music/Rewind.ts index 3a00c01b..4a2fb391 100644 --- a/src/commands/slash/Music/Rewind.ts +++ b/src/commands/slash/Music/Rewind.ts @@ -64,7 +64,9 @@ export default class implements SlashCommand { }); const song_position = player.shoukaku.position; - const CurrentDuration = new FormatDuration().parse(song_position - rewindNum * 1000); + const CurrentDuration = new FormatDuration().parse( + song_position - rewindNum * 1000 + ); if (song_position - rewindNum * 1000 > 0) { await player.send({ diff --git a/src/commands/slash/Utils/247.ts b/src/commands/slash/Utils/247.ts index 77c9b5c1..b8aa6a4a 100644 --- a/src/commands/slash/Utils/247.ts +++ b/src/commands/slash/Utils/247.ts @@ -63,7 +63,9 @@ export default class implements SlashCommand { if (type == "disable") { if (!data.twentyfourseven) { const offAl = new EmbedBuilder() - .setDescription(`${client.i18n.get(language, "music", "247_off_already")}`) + .setDescription( + `${client.i18n.get(language, "music", "247_off_already")}` + ) .setColor(client.color); return msg.edit({ content: " ", embeds: [offAl] }); } @@ -100,20 +102,23 @@ export default class implements SlashCommand { .setColor(client.color), ], }); - + if (data.twentyfourseven) { const onAl = new EmbedBuilder() - .setDescription(`${client.i18n.get(language, "music", "247_on_already")}`) + .setDescription( + `${client.i18n.get(language, "music", "247_on_already")}` + ) .setColor(client.color); return msg.edit({ content: " ", embeds: [onAl] }); } - if (!player) await client.manager.createPlayer({ - guildId: interaction.guild!.id, - voiceId: (interaction.member as GuildMember).voice.channel!.id, - textId: interaction.channel!.id, - deaf: true, - }) + if (!player) + await client.manager.createPlayer({ + guildId: interaction.guild!.id, + voiceId: (interaction.member as GuildMember).voice.channel!.id, + textId: interaction.channel!.id, + deaf: true, + }); await client.db.autoreconnect.set( `${interaction.guild!.id}.twentyfourseven`, diff --git a/src/events/guild/voiceStateUpdate.ts b/src/events/guild/voiceStateUpdate.ts index 1f053044..98552c90 100644 --- a/src/events/guild/voiceStateUpdate.ts +++ b/src/events/guild/voiceStateUpdate.ts @@ -62,6 +62,34 @@ export default class { const leaveEmbed = client.channels.cache.get(player.textId) as TextChannel; + const pauseStatus = !player.paused; + + player.pause(!player.paused); + + try { + if (leaveEmbed) { + const msg = await leaveEmbed.send({ + embeds: [ + new EmbedBuilder() + .setDescription( + `${ + pauseStatus + ? client.i18n.get(language, "player", "leave_pause") + : client.i18n.get(language, "player", "leave_resume") + }` + ) + .setColor(client.color), + ], + }); + setTimeout( + async () => msg.delete(), + client.config.bot.DELETE_MSG_TIMEOUT + ); + } + } catch (error) { + client.logger.error(error); + } + if ( oldState.guild.members.cache.get(client.user!.id)!.voice.channelId === oldState.channelId diff --git a/src/languages/en/player.yaml b/src/languages/en/player.yaml index d619928c..89285ed8 100644 --- a/src/languages/en/player.yaml +++ b/src/languages/en/player.yaml @@ -18,26 +18,18 @@ join_voice: "You need to be in a same/voice channel to use this button." switch_pause: Paused switch_resume: Resumed pause_msg: "`⏯` | *Song has been:* `%{pause}`" - skip_msg: "`⏭` | *Song has been:* `Skipped`" - stop_msg: "`🚫` | *Song has been:* `Stopped`" - shuffle_msg: "`🔀` | *Queue has been:* `Shuffled`" - switch_enable: Enabled switch_disable: Disabled repeat_msg: "`🔁` | *Loop has been:* `%{loop}`" - volup_msg: "`🔊` | *Change volume to:* `%{volume}%`" voldown_msg: "`🔈` | *Change volume to:* `%{volume}%`" - replay_msg: "`⏮` | *Song has been:* `Replayed`" - queue_author: "Queue - %{guild}" queue_description: "*Currently Playing*\n*[%{track}](%{track_url})* `[%{duration}]` • %{requester}\n\n*Rest of queue*:%{list_song}" queue_footer: "Page • %{page}/%{pages} | %{queue_lang} • Song | %{total_duration} • Total duration" - clear_msg: "`📛` | *Queue has been:* `Cleared`" ##### On QueueEnd Event ##### @@ -49,8 +41,6 @@ error_desc: "`❌` | *Song has error:* `Auto-Skipped`" ##### On Track get stuck!! Event ##### stuck_desc: "`❌` | *Song has stuck:* `Auto-Skipped`" -##### On Bot get move Event ##### - # On player get discoconnect dis_title: "Disconnected" dis_desc: "*I've been disconnected from <#%{voice}>*" @@ -60,3 +50,5 @@ leave_title: "Moved" leave_desc: "*I got moved auto disconnected*" player_end: "**Disconnected from <#%{leave}> because I was left alone ;(**" download_title: "Download:" +leave_pause: "`⏸️` | Music has been paused because I was left alone." +leave_resume: "`▶️` | Music has been resumed because somebody join." diff --git a/src/languages/th/filters.yaml b/src/languages/th/filters.yaml deleted file mode 100644 index aab87437..00000000 --- a/src/languages/th/filters.yaml +++ /dev/null @@ -1,41 +0,0 @@ -##### All Filter command! -filter_loading: "กำลังเปิด ฟิลเตอร์ **%{name}**. จะใช้เวลาสักครู่..." -filter_on: "`🔩` | *เปิดฟิลเตอร์:* `%{name}`" -filter_number: "โปรดใส่ตัวเลข" - -filter_greater: "ตัวเลขต้องเยอะกว่า 0" -filter_less: "ตัวเลขต้องน้อยกว่า 10" - -# Bassboost commaand! -bassboost_loading: "ตั้งค่า **Bassboost** เป็น **%{amount}dB**. จะใช้เวลาสักครู่..." -bassboost_set: "`🔩` | *Bassboost เปลี่ยนเป็น:* `%{amount}`" -bassboost_limit: "โปรดใส่ตัวเลข -10 ถึง 10 เท่านั้น" - -# Equalizer command! -eq_author: "ฟิลเตอร์ กำหนดเอง" -eq_icon: "https://cdn.discordapp.com/emojis/758423098885275748.gif" -eq_desc: "มี 14 แบนด์ ที่สามารถตั้งค่าได้ตั้งแต่ -10 ถึง 10 ไม่จำเป็นต้องกรอกทุกแบนด์" -eq_field_title: "ตัวอย่าง:" -eq_field_value: "%{prefix}eq 2 3 0 8 0 5 0 -5 0 0" -eq_number: "แบนด์ #%{num} ไม่ใช่ตัวเลขที่ถูกต้อง" -eq_than: "แบนด์ #%{num} ต้องน้อยกว่า 10" -eq_footer: "รีเซ็ต ฟิลเตอร์: %{prefix}eq reset" - -eq_loading: "ตั้งค่า **Equalizer** เป็น... **`%{bands}`** จะใช้เวลาสักครู่..." -eq_on: "`🔩` | *Equalizer เปลี่ยนเป็น:* `%{bands}`" - -# Pitch command! -pitch_loading: "ตั้งค่า **Pitch** เป็น **%{amount}**. จะใช้เวลาสักครู่..." -pitch_on: "`🔩` | *Pitch เปลี่ยนเป็น:* `%{amount}`" - -# Rate command! -rate_loading: "ตั้งค่า **Rate** เป็น **%{amount}x**. จะใช้เวลาสักครู่..." -rate_on: "`🔩` | *Rate เปลี่ยนเป็น:* `%{amount}x`" - -# Reset command! -reset_loading: "กำลังปิด **ฟิลเตอร์** จะใช้เวลาสักครู่..." -reset_on: "`🔩` | *ปิด:* `ฟิลเตอร์`" - -# Speed command! -speed_loading: "ตั้งค่า **Speed** เป็น **%{amount}x**. จะใช้เวลาสักครู่..." -speed_on: "`🔩` | *Speed เปลี่ยนเป็น:* `%{amount}x`" diff --git a/src/languages/th/help.yaml b/src/languages/th/help.yaml deleted file mode 100644 index 4c18a95e..00000000 --- a/src/languages/th/help.yaml +++ /dev/null @@ -1,14 +0,0 @@ -author: "%{bot} คำสั่งช่วยเหลือ" -welcome: "**ยินดีต้อนรับสู่ %{bot}!**" -intro1: "・**%{bot}** เป็นบอทเพลงขั้นสูงที่มีคุณสมบัติมากมาย" -intro2: "・ขับเคลื่อนโดย RainyXeon/Cylane" -intro3: "・ร่วมมือกับ **บริการที่ 1**" -prefix: "・คำนำหน้าบอทคือ: %{คำนำหน้า}" -intro4: "・ข้อมูลบอท:" -ver: "・**บอท:** `%{botver}`" -djs: "・**Discord.js:** `%{djsver}`" -lavalink: "・**แก้ไขอัตโนมัติ:** `%{aver}`" -help1: "・ประเภทเริ่มต้น: %{help}" -help2: "・ประเภทข้อมูลเพิ่มเติม: %{botinfo}" -wel: "ยินดีต้อนรับสู่ %{bot}!" -codename: "・**ชื่อรหัสบอท**: `%{codename}`" diff --git a/src/languages/th/info.yaml b/src/languages/th/info.yaml deleted file mode 100644 index 28053148..00000000 --- a/src/languages/th/info.yaml +++ /dev/null @@ -1,9 +0,0 @@ -dev_title: "RainyXeon" -dev_desc: "บอทเพลงอเนกประสงค์และทรงพลังสำหรับ Discord ที่นำจังหวะและทำนองมาสู่เซิร์ฟเวอร์ของคุณ" -dev_foot: "ลองเข้าร่วมเซิร์ฟเวอร์หรือเชิญบอท :) สิ่งนี้จะช่วยฉันได้มาก!" - -inv_title: "**ขอบคุณที่เชิญ %{username}**" -inv_desc: "**%{username} ขับเคลื่อนโดย RainyXeon**" - -ping_title: "**ปิงของ **" -ping_desc: "ปิงของฉันคือ ***%{ping}ms***" diff --git a/src/languages/th/interaction.yaml b/src/languages/th/interaction.yaml deleted file mode 100644 index bf15bc1a..00000000 --- a/src/languages/th/interaction.yaml +++ /dev/null @@ -1,13 +0,0 @@ -##### InteractionCreate Event ##### - -# On settings/config.js in DEV_ID -dev_only: "บอทอยู่ในระหว่างการพัฒนา (กรุณากลับมาใหม่ภายหลัง)" - -# No permission to use command (this for bot!) -no_perms: "ฉันไม่มีสิทธิ์ดำเนินการคำสั่ง!" - -# Bot getting error something! -error: "อะไรบางอย่างผิดปกติ." - -# You are not the client owner of this bot! -owner_only: "คุณไม่ใช่เจ้าของบอท" diff --git a/src/languages/th/music.yaml b/src/languages/th/music.yaml deleted file mode 100644 index 92923e39..00000000 --- a/src/languages/th/music.yaml +++ /dev/null @@ -1,203 +0,0 @@ -### 247 command -247_loading: "กำลังโหลด โปรดรอสักครู่..." -247_invalid: "โหมด 247 ไม่ถูกต้อง" -247_off: "`🌙` | *โหมด 24/7 ได้ถูก:* `ปิดการใช้งาน`" -247_on: "`🌕` | *โหมด 24/7 ได้ถูก:* `เปิดการใช้งาน`" -247_on_already: "`🌕` | *24/7 อยู่ในโหมดแล้ว:* `เปิดใช้งานแล้ว`" -247_off_already: "`🌙` | *24/7 อยู่ในโหมดแล้ว:* `ปิดใช้งานแล้ว`" - -### Autoplay command! -autoplay_loading: "กำลังโหลด โปรดรอสักครู่..." -autoplay_off: "`📻` | *เล่นอัตโนมัติ ได้ถูก:* `ปิดการใช้งาน`" -autoplay_on: "`📻` | *เล่นอัตโนมัติ ได้ถูก:* `เปิดการใช้งาน`" - -### Clearqueue command! -clearqueue_loading: "กำลังโหลด โปรดรอสักครู่..." -clearqueue_msg: "`📛` | *คิวได้ถูก:* `เคลียร์`" - -### Forward command! -forward_loading: "กำลังโหลด โปรดรอสักครู่..." -forward_msg: "`⏭` | *ข้ามไปยัง:* `%{duration}`" -forward_beyond: "ไม่สามารถ ข้าม เกินระยะเวลาของเพลง" -forward_invalid: "โปรดใช้ตัวเลข\nการใช้งานที่ถูกต้อง: `%{prefix}forward <วินาที>`" - -### Join command! -join_loading: "กำลังโหลด โปรดรอสักครู่..." -join_voice: "คุณต้องอยู่ในห้องเสียงเพื่อใช้คำสั่ง" -join_msg: "`🔊` | *เข้าห้อง:* `%{channel}`" - -### Leave command! -stop_loading: "กำลังโหลด โปรดรอสักครู่..." -stop_msg: "`👋` | *บอทถูก:* `ตัดการเชื่อมต่อ`" - -### Loop command! -loop_loading: "กำลังโหลด โปรดรอสักครู่..." -loop_invalid: "โหมดวนซ้ำไม่ถูกต้อง เฉพาะ %{mode}" -loop_current: "`🔁` | *โหมดวนซ้ำ:* `ปัจจุบัน`" -unloop_current: "`🔁` | *ยกเลิก ลูปเพลง:* `ปัจจุบัน`" -loop_all: "`🔁` | *โหมดวนซ้ำ:* `คิว`" -unloop_all: "`🔁` | *โหมดวนซ้ำ:* `ไม่มี`" - -### Loopall command! -loopall_loading: "กำลังโหลด โปรดรอสักครู่..." -loopall: "`🔁` | *ลูปเพลง:* `ทั้งหมด`" -unloopall: "`🔁` | *โหมดวนซ้ำ:* `ไม่มี`" - -### Lyrics command! -lyrics_loading: "กำลังค้นหาเนื้อเพลง..." -lyrics_notfound: "ไม่พบเนื้อเพลงสำหรับเพลงนี้!" -lyrics_title: "เนื้อเพลง %{song}" -lyrics_toolong: "เนื้อเพลงยาวเกินไปที่จะแสดง!" - -### Nowplaying command! -np_loading: "กำลังโหลด โปรดรอสักครู่..." - -np_title: "กำลังเล่น เพลง..." -np_title_pause: "เพลงถูกหยุด..." -np_icon: "https://cdn.discordapp.com/emojis/741605543046807626.gif" - -# Embed Field -np_author: "ช่อง:" -np_request: "ผู้ร้องขอ:" -np_volume: "ระดับเสียง:" -np_view: "ยอดวิว:" -np_upload: "อัปโหลด:" -np_download: "ดาวน์โหลด:" -np_current_duration: "ระยะเวลาปัจจุบัน: `[%{current_duration} / %{total_duration}]`" - -# Need in voice to use button -np_invoice: "คุณต้องอยู่ใน ห้องเสียง/เดียวกัน เพื่อจะใช้ปุ่มนี้" - -# Message Button -np_switch_pause: "หยุดชั่วคราว" -np_switch_resume: "ดำเนินการต่อ" -np_pause_msg: "`⏯` | *เพลงได้ถูก:* `%{pause}`" - -np_replay_msg: "`⏮` | *เพลงได้ถูก:* `เล่นซ้ำ`" - -np_stop_msg: "`🚫` | *เพลงได้ถูก:* `ปิด`" - -np_skip_msg: "`⏭` | *เพลงได้ถูก:* `ข้าม`" - -np_switch_enable: "เปิดการใช้งาน" -np_switch_disable: "ปิดการใช้งาน" -np_repeat_msg: "`🔁` | *ลูปได้ถูก:* `%{loop}`" - -### Pause command! -pause_loading: "กำลังโหลด โปรดรอสักครู่..." -pause_switch_pause: "หยุดชั่วคราว" -pause_switch_resume: "ดำเนินการต่อ" -pause_msg: "`⏯` | *เพลงได้ถูก:* `%{pause}`" - -### Play command! -play_loading: "🔍 **กำลังค้นหา...** `%{result}`" -play_invoice: "คุณต้องอยู่ใน ห้องเสียง เพื่อใช้คำสั่ง" -play_join: "ฉันไม่ได้รับอนุญาตให้เข้าร่วม ห้องเสียง ของคุณ" -play_speak: "ฉันไม่ได้รับอนุญาตให้พูดใน ห้องเสียง ของคุณ" -play_arg: "กรุณาระบุชื่อเพลงหรือลิงค์เพื่อค้นหา" -play_startwith: "จำเป็นต้องเป็นลิ้งเพลงเท่านั้น" -play_invalid_file: "โปรดใช้ไฟล์เพลงที่ถูกต้องเพื่อใช้คุณสมบัตินี้. โปรดทราบว่ารองรับเฉพาะนามสกุล mp3/ogg เท่านั้น ไม่รองรับนามสกุลไฟล์เพลงระดับมืออาชีพ เช่น flac/wav" -play_warning_file: "คำเตือน: ระบบตรวจไม่พบประเภทไฟล์ของคุณ ระบบอาจไม่สามารถเล่นเพลงได้ เราขอแนะนำให้คุณเลือกประเภทไฟล์ที่มีนามสกุล .mp3" - -play_track: "**เพิ่มเพลง • [%{title}](%{url})** `%{duration}` • %{request}" -play_playlist: "**เพิ่มเพลง • [%{title}](%{url})** `%{duration}` (%{songs} เพลง) • %{request}" -play_result: "**เพิ่มเพลง • [%{title}](%{url})** `%{duration}` • %{request}" - -play_fail: "เกิดข้อผิดพลาดในการค้นหาเพลง" -play_match: "เพลงผิดพลาดไม่ตรงกัน" - -### Previous command! -previous_loading: "กำลังโหลด โปรดรอสักครู่..." -previous_notfound: "ไม่พบเพลง/เพลงก่อนหน้า" -previous_msg: "`⏮` | *เพลงได้ถูก:* `ย้อนกลับ`" - -### Queue command! -queue_author: "คิว - %{guild}" -queue_description: "**เพลงที่กำลังเล่น**\n**[%{title}](%{url})** `[%{duration}]` • %{request}\n\n**คิวที่เหลือ**:%{rest}" -queue_footer: "หน้าที่ • %{page}/%{pages} | %{queue_lang} • เพลง | ระยะเวลาทั้งหมด • %{duration}" -queue_notnumber: "หน้า ต้องเป็นตัวเลข" -queue_page_notfound: "มีเพียง %{page} หน้าใช้ได้" - -### Replay command! -replay_loading: "กำลังโหลด โปรดรอสักครู่..." -replay_msg: "`⏮` | *เพลงได้ถูก:* `เล่นซ้ำ`" - -### Resume command! -resume_loading: "กำลังโหลด โปรดรอสักครู่..." -resume_switch_pause: "หยุดชั่วคราว" -resume_switch_resume: "ดำเนินการต่อ" -resume_msg: "`⏯` | *เพลงได้ถูก:* `%{resume}`" - -### Rewind command! -rewind_loading: "กำลังโหลด โปรดรอสักครู่..." -rewind_msg: "`⏮` | *ย้อนไปยัง:* `%{duration}`" -rewind_beyond: "ไม่สามารถ ย้อน เกินระยะเวลาของเพลง" -rewind_invalid: "โปรดใช้ตัวเลข\nการใช้งานที่ถูกต้อง: `%{prefix}rewind <วินาที>`" - -### RemoveTrack command! -removetrack_loading: "กำลังโหลด โปรดรอสักครู่..." - -removetrack_already: "ไม่สามารถลบเพลงที่กำลังเล่นอยู่" -removetrack_notfound: "ไม่พบเพลง" - -removetrack_desc: "**ลบแล้ว • [%{name}](%{url})** `%{duration}` • %{request}" - -### Search command! -search_loading: "กำลังโหลด โปรดรอสักครู่..." -search_invoice: "คุณต้องอยู่ในห้องเสียงเพื่อใช้คำสั่" -search_join: "ฉันไม่ได้รับอนุญาตให้เข้าร่วม ห้องเสียง ของคุณ" -search_speak: "ฉันไม่ได้รับอนุญาตให้พูดใน ห้องเสียง ของคุณ" -search_arg: "กรุณาระบุชื่อเพลงเพื่อค้นหา" - -search_title: "เลือกเพลง..." -search_select: "**(%{num}.) [%{title}](%{url})** `%{duration}` ช่อง: `%{author}`" -search_footer: "กรุณาเลือกเพลงใน 30 วินาที" -search_no_response: "ไม่มีการตอบสนอง" - -search_result: "**เพิ่มเพลง • [%{title}](%{url})** `%{duration}` • %{request}" -search_playlist: "**เพิ่มเพลง • [%{title}](%{url})** `%{duration}` (%{songs} เพลง) • %{request}" - -search_fail: "เกิดข้อผิดพลาดในการค้นหาเพลง" -search_match: "เพลงผิดพลาดไม่ตรงกัน" - -### Seek command! -seek_loading: "กำลังโหลด โปรดรอสักครู่..." -seek_invalid: "รูปแบบไม่ถูกต้อง. โปรดระบุการประทับเวลา\nตัวอย่าง: `%{prefix}seek 0:59 หรือ 120:00`" -seek_beyond: "ไม่สามารถ ข้าม/ย้อน เกินความยาวของเพลง" -seek_msg: "`⏭` | *ข้ามไปที่:* `%{duration}`" - -### Shuffle command! -shuffle_loading: "กำลังโหลด โปรดรอสักครู่..." -shuffle_msg: "`🔀` | *คิวได้ถูก:* `สุ่ม`" - -### Skip command! -skip_loading: "กำลังโหลด โปรดรอสักครู่..." -skip_msg: "`⏭` | *เพลงได้ถูก:* `ข้าม`" - -### Skipto command! -skipto_loading: "กำลังโหลด โปรดรอสักครู่..." -skipto_invalid_position: "หมายเลขไม่ถูกต้อง" -skipto_arg: "ไม่สามารถข้ามไปยังเพลงที่เล่นอยู่ ถ้าจะข้ามเพลงที่กำลังเล่นอยู่ พิมพ์: `%{prefix}skip`" -skipto_invalid: "หมายเลขเพลงไม่ถูกต้อง" -skipto_msg: "`⏭` | *เพลงได้ถูก:* `ข้ามไปคิวที่ %{position}`" - -### Volume command! -volume_loading: "กำลังโหลด โปรดรอสักครู่..." -volume_usage: "*ระดับเสียงปัจจุบัน:* `%{volume}%`" -volume_invalid: "คุณสามารถตั้งค่าระดับเสียง 1% ถึง 100% เท่านั้น" -volume_msg: "`🔊` | *เปลี่ยนระดับเสียงเป็น:* `%{volume}%`" - -### Radio command! -radio_invalid: "หมายเลขไม่ถูกต้อง โปรดเลือกตัวเลขตั้งแต่ 1-34 \nสำหรับรายการวิทยุ กรุณาพิมพ์ /music radio" -radio_invoice: "คุณต้องอยู่ในช่องเสียงเพื่อใช้คำสั่ง" -radio_join: "ฉันไม่ได้รับอนุญาตให้เข้าร่วมช่องเสียงของคุณ" -radio_speak: "ฉันไม่ได้รับอนุญาตให้พูดในช่องเสียงของคุณ" -radio_loading: "กำลังโหลด โปรดรอสักครู่..." -radio_track: "**เพิ่มเพลง • [%{title}](%{url})** `%{duration}` • %{request}" -radio_match: "วิทยุนี้ขัดข้อง ลิงก์ผิดพลาดหรือเสีย โปรดรายงานข้อผิดพลาดนี้ไปยัง XeonDex #0017 เพื่อแก้ไข!" - -### Utils -number_invalid: "โปรดใช้ตัวเลข" -enabled: "เปิดใช้งาน" -disabled: "ปิดการใช้งาน" -no_node: "ไม่มีเซิร์ฟเวอร์ lavalink ที่ใช้งานได้! \nโปรดลองอีกครั้งหลังจาก 5 นาที" diff --git a/src/languages/th/noplayer.yaml b/src/languages/th/noplayer.yaml deleted file mode 100644 index 24499dad..00000000 --- a/src/languages/th/noplayer.yaml +++ /dev/null @@ -1,9 +0,0 @@ -##### Need to join voice channel to use command! ##### - -# No song playing in guild! -no_player: "ไม่มีเพลงที่กำลังเล่นอยู่ในกิลด์นี้ หรือบอทไม่ได้เข้าร่วมช่อง" - -# Need to join voice & same voice to use command! -no_voice: "คุณต้องอยู่ใน ห้องเสียง/เดียวกัน" -no_voice_247: "คุณต้องเข้าร่วมช่องเสียง" -no_music: "คุณต้องเล่นเพลงเพื่อใช้คำสั่งนี้" diff --git a/src/languages/th/nopremium.yaml b/src/languages/th/nopremium.yaml deleted file mode 100644 index c7121c8a..00000000 --- a/src/languages/th/nopremium.yaml +++ /dev/null @@ -1,5 +0,0 @@ -##### No premium Event ##### -#No premium sending msg! -premium_author: "พรีเมี่ยม!" -premium_desc: "*คุณต้องเป็นพรีเมี่ยมเพื่อใช้คำสั่งนี้*" -premium_error: "เกิดข้อผิดพลาด โปรดลองอีกครั้งในภายหลัง" diff --git a/src/languages/th/player.yaml b/src/languages/th/player.yaml deleted file mode 100644 index 91cee2f0..00000000 --- a/src/languages/th/player.yaml +++ /dev/null @@ -1,62 +0,0 @@ -##### On track start playing! Event ##### -track_title: "กำลังเล่น เพลง..." -track_icon: "https://cdn.discordapp.com/emojis/741605543046807626.gif" - -# Embed Field -author_title: "ช่อง:" -request_title: "ผู้ร้องขอ:" -volume_title: "เสียงปัจจุบัน:" -queue_title: "ความยาวคิว:" -duration_title: "ระยะเวลา:" -total_duration_title: "ระยะเวลาทั้งหมด:" -current_duration_title: "ระยะเวลาปัจจุบัน: `[0:00 / %{current_duration}]`" - -# Need in voice to use button! -join_voice: "คุณต้องอยู่ใน ห้องเสียง/เดียวกัน เพื่อจะใช้ปุ่มนี้" - -# Message Button -switch_pause: "หยุดชั่วคราว" -switch_resume: "ดำเนินการต่อ" -pause_msg: "`⏯` | *เพลงได้ถูก:* `%{pause}`" - -skip_msg: "`⏭` | *เพลงได้ถูก:* `ข้าม`" - -stop_msg: "`🚫` | *เพลงได้ถูก:* `ปิด`" - -shuffle_msg: "`🔀` | *คิวได้ถูก:* `สุ่ม`" - -switch_enable: "เปิดใช้งาน" -switch_disable: "ปิดใช้งาน" -repeat_msg: "`🔁` | *ลูปได้ถูก:* `%{loop}`" - -volup_msg: "`🔊` | *เปลี่ยนระดับเสียงเป็น:* `%{volume}%`" -voldown_msg: "`🔈` | *เปลี่ยนระดับเสียงเป็น:* `%{volume}%`" - -replay_msg: "`⏮` | *เพลงได้ถูก:* `เล่นซ้ำ`" - -queue_author: "คิว - %{guild}" -queue_description: "**เพลงที่กำลังเล่น**\n**[%{track}](%{track_url})** `[%{duration}]` • %{requester}\n\n**คิวที่เหลือ**:%{list_song}" -queue_footer: "หน้า • %{page}/%{pages} | %{queue_lang} • เพลง | ระยะเวลาทั้งหมด • %{total_duration}" - -clear_msg: "`📛` | *คิวได้ถูก:* `เคลียร์`" - -##### On QueueEnd Event ##### -queue_end_desc: "`📛` | *เพลงได้:* `จบลงแล้ว`" - -##### On Track get error!! Event ##### -error_desc: "`❌` | *เพลงมีข้อผิดพลาด:* `ข้ามอัตโนมัติ`" - -##### On Track get stuck!! Event ##### -stuck_desc: "`❌` | *เพลงติด:* `ข้ามอัตโนมัติ`" - -##### On Bot get move Event ##### - -# On player get discoconnect -dis_title: "ตัดการเชื่อมต่อ" -dis_desc: "*ฉันถูกตัดการเชื่อมต่อจาก <#%{voice}>*" - -# On player get move! = (detroy player) -leave_title: "ย้าย" -leave_desc: "*ฉันถูกย้าย ตัดการเชื่อมต่ออัตโนมัติ*" -player_end: "**ตัดการเชื่อมต่อจาก <#%{leave}> เพราะฉันถูกทิ้งให้อยู่ตามลำพัง ;(**" -download_title: "ดาวน์โหลด:" diff --git a/src/languages/th/playlist.yaml b/src/languages/th/playlist.yaml deleted file mode 100644 index 81b919ba..00000000 --- a/src/languages/th/playlist.yaml +++ /dev/null @@ -1,128 +0,0 @@ -##### Create command ##### -create_loading: "**กำลังสร้างเพลย์ลิสต์...**" -create_arg: "โปรดระบุ ตัวอย่าง: %{prefix}create <ชื่อเพลย์ลิสต์>" -create_toolong: "ชื่อเพลย์ลิสต์ต้องมีความยาวไม่เกิน 16 อักขระ" -create_limit_playlist: "คุณมีเพลย์ลิสต์ได้ไม่เกิน %{limit} เพลย์ลิสต์" -create_name_exist: "ชื่อเพลย์ลิสต์นี้มีอยู่แล้วในฐานข้อมูล" -create_created: "`📦` | *สร้างเพลย์ลิสต์* • `%{playlist}` • `%{id}`" -des_toolong: "คำอธิบายเพลย์ลิสต์ต้องมีความยาวไม่เกิน 1,000 อักขระ" - -##### Add command ##### -add_loading: "**กำลังเพิ่มเข้าเพลย์ลิสต์...**" -add_arg: "โปรดระบุ ตัวอย่าง: %{prefix}add <ชื่อเพลย์ลิสต์> <ลิ้ง หรือ ชื่อเพลง>" -add_match: "ลิงก์เพลย์ลิสต์ไม่ถูกต้อง" -add_fail: "เกิดข้อผิดพลาดในการโหลดเพลย์ลิสต์" -add_track: "**ค้นหา • [%{title}](%{url})** `%{duration}` • %{user}" -add_playlist: "**ค้นหา • [%{title}](%{url})** `%{duration}` (%{track} เพลง) • %{user}" -add_search: "**ค้นหา • [%{title}](%{url})** `%{duration}` • %{user}" -add_owner: "คุณไม่สามารถเพิ่มลงในเพลย์ลิสต์นี้ได้" -add_limit_track: "คุณไม่สามารถเพิ่มมากกว่า %{limit} เพลง ในเพลย์ลิสต์นี้" -add_added: "`📦` | *เพิ่ม* • [`%{count} เพลง`] เข้า *เพลย์ลิสต์* • `%{playlist}`" - -##### Delete command ##### -delete_arg: "โปรดระบุ ตัวอย่าง: %{prefix}delete <ชื่อเพลย์ลิสต์>" -delete_notfound: "ไม่พบเพลย์ลิสต์!" -delete_confirm: "คุณต้องการลบ `%{playlist_id}` หรือไม่?" -delete_no: "ยกเลิกการลบแล้ว!" -delete_owner: "คุณไม่สามารถลบเพลย์ลิสต์นี้ได้" -delete_deleted: "`📦` | *ลบเพลย์ลิสต์* • %{name}" - -##### Detail command ##### -detail_arg: "โปรดระบุ ตัวอย่าง: %{prefix}detail <ชื่อเพลย์ลิสต์>" -detail_notfound: "ไม่พบเพลย์ลิสต์!." -detail_private: "เพลย์ลิสต์นี้เป็นแบบส่วนตัว" -detail_embed_title: "เพลย์ลิสต์ • %{name}" -detail_embed_footer: "หน้าที่ • %{page}/%{pages} | %{songs} • เพลง | ระยะเวลาทั้งหมด • %{duration}" -detail_notnumber: "หน้าต้องเป็นตัวเลข" -detail_page_notfound: "มีเพียง %{page} หน้าที่ใช้ได้" -detail_track: "%{num}. **[%{title}](%{url})** | *ช่อง*: %{author} | `[%{duration}]`" - -##### Import command ##### -import_loading: "กำลังนำเพิ่ม เพลย์ลิสต์ไปยังคิว..." -import_voice: "คุณต้องอยู่ใน ห้องเสียง เพื่อใช้คำสั่ง" -import_join: "ฉันไม่ได้รับอนุญาตให้เข้าร่วม ห้องเสียง ของคุณ" -import_speak: "ฉันไม่ได้รับอนุญาตให้พูดใน ห้องเสียง ของคุณ" -import_arg: "โปรดระบุชื่อเพลย์ลิสต์ ตัวอย่าง: %{prefix}import <ชื่อเพลย์ลิสต์>**" -import_notfound: "ไม่พบเพลย์ลิสต์!" -import_private: "เพลย์ลิสต์นี้เป็นแบบส่วนตัว" -import_imported: "**เพิ่มเพลย์ลิสต์ • %{name}** `[%{duration}]` (%{tracks} เพลง) • %{user}" -import_match: "เกิดข้อผิดพลาดเพลย์ลิสต์ไม่ถูกต้อง" -import_fail: "เกิดข้อผิดพลาดในการโหลดเพลย์ลิสต์" -import_empty: "เพลย์ลิสต์ไม่มีเพลง" - -##### View command ##### -view_embed_title: "%{user}'s • เพลย์ลิสต์" -view_embed_footer: "หน้าที่ • %{page}/%{pages} | %{songs} • เพลย์ลิสต์" -view_notnumber: "หน้าต้องเป็นตัวเลข" -view_page_notfound: "มีเพียง %{page} หน้าที่ใช้ได้" -view_embed_playlist: "%{num}. **`%{name}`** • (%{tracks} เพลง) • *สร้างตั้งแต่*: `[%{create} ที่แล้ว]`" - -##### Remove command ##### -remove_arg: "โปรดระบุ ตัวอย่าง: %{prefix}remove <ชื่อเพลย์ลิสต์> <ตำแหน่ง>" -remove_notfound: "ไม่พบเพลย์ลิสต์!" -remove_song_notfound: "ไม่พบเพลงที่จะลบ" -remove_owner: "คุณไม่สามารถลบเพลงออกจากเพลย์ลิสต์นี้ได้" -remove_removed: "`📦` | *ลบเพลง* • ตำแหน่งที่ `%{position}` ในเพลย์ลิสต์ `%{name}`" - -##### Savequeue command ##### -savequeue_arg: "โปรดระบุ ตัวอย่าง: %{prefix}savequeue <ชื่อเพลย์ลิสต์>" -savequeue_notfound: "ไม่พบเพลย์ลิสต์!" -savequeue_owner: "คุณไม่สามารถบันทึกเพลงลงในเพลย์ลิสต์นี้ได้" -savequeue_saved: "`📦` | *บันทึก* • (%{tracks} เพลง) ลงในเพลย์ลิสต์ `%{name}`" -savequeue_no_new_saved: "ไม่มีการบันทึกแทร็กใหม่ในเพลย์ลิสต์ `%{name}`" -savequeue_no_tracks: "ไม่มีแทร็กอยู่ในคิว!" - -##### Public command ##### -public_arg: "โปรดระบุ ตัวอย่าง: %{prefix}public <ชื่อเพลย์ลิสต์>" -public_notfound: "ไม่พบเพลย์ลิสต์!" -public_owner: "คุณไม่สามารถปรับ เพลย์ลิสต์ เป็นสาธารณะได้" -public_already: "เพลย์ลิสต์นี้ ได้เป็นแบบสาธารณะอยู่แล้ว" -public_loading: "กำลังโหลด โปรดรอสักครู่..." -public_success: "`📦` | *เพลย์ลิสต์ ถูกปรับเป็น:* `%{view}`" -public: "สาธารณะ" -private: "ส่วนตัว" - -##### Info Command ###### -info_title: "ข้อมูลเพลย์ลิสต์ %{name}:" -info_name: "ชื่อ:" -info_id: "รหัส:" -info_total: "เพลงทั้งหมด:" -info_created: "สร้าง:" -info_private: "การมองเห็น:" -info_owner: "เจ้าของ:" -info_des: "คำอธิบาย:" -invalid: "ไม่พบเพลย์ลิสต์!" -no_des: "ไม่มีคำบรรยาย" -enabled: "เปิดใช้งาน" -disabled: "พิการ" - -##### แก้ไขคำสั่ง ##### -edit_arg: "โปรดระบุรหัสเพลย์ลิสต์!" -edit_playlist_id_label: "รหัสเพลย์ลิสต์ใหม่ใช่ไหม" -edit_playlist_name_label: "รหัสเพลย์ลิสต์ใหม่เหรอ?" -edit_playlist_des_label: "คำอธิบายเพลย์ลิสต์ใหม่เหรอ?" -edit_playlist_private_label: "โหมดดู? [public/private]" -edit_notfound: "ไม่พบเพลย์ลิสต์!" -edit_playlist_owner: "คุณไม่สามารถแก้ไขเพลย์ลิสต์นี้ได้" -edit_loading: "กำลังโหลด..." -edit_success: "แก้ไขข้อมูลเพลย์ลิสต์เรียบร้อยแล้ว • %{playlistId}" -edit_id_invalid: "รหัสใหม่ไม่ถูกต้อง" -edit_invalid_mode: "โหมดการมองเห็นใหม่ไม่ถูกต้อง" - -##### แก้ไขการโต้ตอบคำสั่ง ##### -ineraction_edit_title: "ตัวแก้ไขเพลย์ลิสต์" -ineraction_edit_playlist_id_label: "รหัสเพลย์ลิสต์ใหม่ใช่ไหม" -ineraction_edit_playlist_name_label: "ชื่อเพลย์ลิสต์ใหม่เหรอ?" -ineraction_edit_playlist_des_label: "คำอธิบายเพลย์ลิสต์ใหม่ใช่ไหม" -ineraction_edit_playlist_private_label: "โหมดดู? [public/private]" -ineraction_edit_playlist_error: "มีบางอย่างผิดพลาดกับโมดอล โปรดลองอีกครั้ง" -ineraction_edit_playlist_name_placeholder: "ป้อนชื่อเพลย์ลิสต์ใหม่ของคุณ!" -ineraction_edit_playlist_des_placeholder: "ป้อนคำอธิบายเพลย์ลิสต์ใหม่ของคุณ!" -ineraction_edit_playlist_private_placeholder: "public/private" -ineraction_edit_playlist_id_placeholder: "ป้อนรหัสเพลย์ลิสต์ใหม่ของคุณ! (a-zA-Z0-9- เท่านั้น)" -ineraction_edit_notfound: "ไม่พบเพลย์ลิสต์!" -ineraction_edit_loading: "กำลังโหลด....." -ineraction_edit_success: "แก้ไขข้อมูลเพลย์ลิสต์เรียบร้อยแล้ว • %{playlistId}" -ineraction_edit_playlist_owner: "คุณไม่สามารถแก้ไขเพลย์ลิสต์นี้ได้" -ineraction_edit_invalid_id: "รหัสใหม่ไม่ถูกต้อง" -ineraction_edit_invalid_mode: "โหมดการมองเห็นใหม่ไม่ถูกต้อง" diff --git a/src/languages/th/premium.yaml b/src/languages/th/premium.yaml deleted file mode 100644 index e285d5c2..00000000 --- a/src/languages/th/premium.yaml +++ /dev/null @@ -1,22 +0,0 @@ -##### Generate command ##### -provide_plan: "โปรดระบุแผน: %{plans}" -plan_invalid: "แผนไม่ถูกต้อง แผนที่มีอยู่: %{plans}" -gen_author: "Generate Code" -gen_desc: "• *Generated* [`+%{codes_length}`]\n```%{codes}```\n • *แผน*: `%{plan}`\n • *วันหมดอายุ*: `%{expires}`" -gen_footer: "ใช้: %{prefix}redeem เพื่อรับโค้ด!" -##### Profile command ##### -profile_author: "โปรไฟล์พรีเมี่ยม" -profile_desc: "*ผู้ใช้*: `%{user}`\n*แผน*: `%{plan}`\n*วันหมดอายุ*: `%{expires}`" -##### Redeem command ##### -redeem_arg: "โปรดระบุโค้ดที่คุณต้องการแลก!" -redeem_already: "คุณเป็นผู้ใช้ระดับพรีเมียมแล้ว" -redeem_title: "แลกพรีเมี่ยม" -redeem_desc: "**คุณได้แลกรับ พรีเมียมเรียบร้อยแล้ว!**\n\n*วันหมดอายุ*: [`%{expires}`]" -redeem_invalid: "**โค้ดไม่ถูกต้อง โปรดลองอีกครั้งโดยใช้อันที่ถูกต้อง!**" -##### Remove command ##### -remove_mention: "โปรดแท็กสมาชิก!" -remove_already: "**สมาชิก %{user} ได้ทุกลบไปแล้ว**" -remove_desc: "**ตุณได้ลบสมาชิกสำเร็จ %{user}**" -remove_no_params: "คุณต้องระบุรหัสหรือพูดถึง!" -remove_only_params: "คุณต้องระบุเพียง 1 id หรือพูดถึง!" -remove_404: "ไม่พบผู้ใช้ %{userid} ในฐานข้อมูล!" diff --git a/src/languages/th/radio.yaml b/src/languages/th/radio.yaml deleted file mode 100644 index b4e92621..00000000 --- a/src/languages/th/radio.yaml +++ /dev/null @@ -1,2 +0,0 @@ -available_radio: "**สถานีวิทยุที่มีอยู่**" -standard_radio: "***:radio: วิทยุมาตรฐาน***" diff --git a/src/languages/th/setup.yaml b/src/languages/th/setup.yaml deleted file mode 100644 index 695e0383..00000000 --- a/src/languages/th/setup.yaml +++ /dev/null @@ -1,26 +0,0 @@ -##### Setup command ##### -setup_topic: "⏯ *หยุดชั่วคราว/ดำเนินการต่อ ของเพลง*\n⬅ *กลับไปเพลงก่อนหน้า*\n⏹ *ปิดเพลง/เอาบอทออกจากห้อง*\n➡ *ข้ามไปเพลงต่อไป*\n🔁 *เล่นเพลงซ้ำ/ยกเลิกเล่นเพลงซ้ำ*" -setup_msg: "*`สร้างระบบ แชทเพลง สำเร็จ`* %{channel}\n```คำเตือน: ห้ามลบอะไรก็ตามแต่ที่บอทได้ส่งทิ้งไว้! (เพื่อให้บอทยังทำงานได้! ถ้าลบไปแล้วให้สร้างใหม่)```" -setup_deleted: "*`ลบช่องเพลงเรียบร้อยแล้ว!`*" -setup_null: "*`ไม่มีช่องที่จะลบ!`*" - -##### Setup Handler ##### -setup_queuemsg: "**__คิวทั้งหมด:__**\nเข้าห้องพูดคุยแล้วเพิ่มเพลงโดย ใช้ชื่อหรือลิ้งเพลง ในห้องนี้" - -setup_playembed_author: "ไม่มีเพลง เล่นอยู่ ในปัจจุบัน" - -##### Setup Update Handler ##### - -setup_author: "กำลังเล่น เพลง..." -setup_author_icon: "https://cdn.discordapp.com/emojis/741605543046807626.gif" -setup_desc: "[%{title}](%{url}) `[%{duration}]` • %{request}" -setup_footer: "%{songs} • เพลงในคิว | ระดับเสียง • %{volume}% | ระยะเวลาทั้งหมด • %{duration}" - -setup_content: "**__คิวทั้งหมด:__**" -setup_content_queue: "*`%{index} • %{title} • [%{duration}]`* • %{request}" -setup_content_empty: "เข้าห้องพูดคุยแล้วเพิ่มเพลงโดย ใช้ชื่อหรือลิ้งเพลง ในห้องนี้" - -setup_enable: "*`มีช่องการตั้งค่าอยู่แล้ว ไม่สามารถใช้คำสั่งนี้ได้`*" -status_deleted: "*`ลบช่องสถานะสำเร็จแล้ว!`*" -status_enable: "*`มีช่องสถานะอยู่แล้ว ไม่สามารถใช้คำสั่งนี้ได้`*" -status_null: "*`ไม่มีช่องที่จะลบ!`*" diff --git a/src/languages/th/utilities.yaml b/src/languages/th/utilities.yaml deleted file mode 100644 index eeeffac6..00000000 --- a/src/languages/th/utilities.yaml +++ /dev/null @@ -1,27 +0,0 @@ -##### Language command ##### -lang_perm: "คุณต้องมีความสามารถ `MANAGE_GUILD` เพื่อใช้คำสั่ง" -lang_arg: "กรุณาระบุภาษา!" -provide_lang: "**โปรดระบุภาษา:** \n`%{languages}`" -lang_set: "`🔧` | *ภาษาถูกตั้งค่าเป็น:* `%{language}`" -lang_change: "`🔧` | *ภาษาถูกเปลี่ยนเป็น:* `%{language}`" -lang_error: "เกิดข้อผิดพลาด โปรดลองอีกครั้งในภายหลัง" - -##### Restart command ##### -restart_msg: "`🤖` | *บอทได้ถูก:* `ปิดตัวลงแล้ว`" - -##### PLayer control command ##### -control_perm: "คุณต้องได้รับอนุญาตจาก `MANAGE_GUILD` เพื่อใช้คำสั่งนี้." -control_set: "`🔧` | *โหมดควบคุมผู้เล่นถูกตั้งค่าเป็น:* `%{toggle}`" -control_change: "`🔧` | *โหมดควบคุมผู้เล่นถูกเปลี่ยนเป็น:* `%{toggle}`" -control_err: "เกิดข้อผิดพลาดขณะตั้งค่าโหมดควบคุมเครื่องเล่น!" - -##### Help command ##### -help_desc: "โปรดเลือกหัวข้อ" -help_category_desc: "เลือก %{category} เพื่อดูคำสั่งทั้งหมด" -help_category: "%{category}" -help_timeout: "```การดูคำสั่งบอทหมดเวลาแล้ว พิมพ์ %{prefix}help เพื่อดูอีกครั้ง```" - -arg_error: "โปรดระบุ `%{text}`!" - -page_title: "ออนไลน์: 🟢 / ออฟไลน์: 🔴" -page_footer: "หน้า • %{page}/%{pages}" diff --git a/src/languages/vi/player.yaml b/src/languages/vi/player.yaml index 79ccb8ea..0eb7ec5a 100644 --- a/src/languages/vi/player.yaml +++ b/src/languages/vi/player.yaml @@ -18,26 +18,18 @@ join_voice: "Bạn cần ở trong cùng một kênh thoại để sử dụng n switch_pause: Đã tạm dừng switch_resume: Đã bật lại pause_msg: "`⏯` | *Bài hát đã:* `%{pause}`" - skip_msg: "`⏭` | *Bài hát đã:* `Skipped`" - stop_msg: "`🚫` | *Bài hát đã:* `Stopped`" - shuffle_msg: "`🔀` | *Hàng đợi đã:* `Shuffled`" - switch_enable: Đã kích hoạt switch_disable: Đã vô hiệu hóa repeat_msg: "`🔁` | *Loop has been:* `%{loop}`" - volup_msg: "`🔊` | *Chuyển âm lượng thành:* `%{volume}%`" voldown_msg: "`🔈` | *Chuyển âm lượng thành:* `%{volume}%`" - replay_msg: "`⏮` | *Bài hát đã:* `Replayed`" - queue_author: "Hàng đợi - %{guild}" queue_description: "*Đang chơi bài*\n*[%{track}](%{track_url})* `[%{duration}]` • %{requester}\n\n*Rest of queue*:%{list_song}" queue_footer: "Trang • %{page}/%{pages} | %{queue_lang} • Nhạc | %{total_duration} • Total duration" - clear_msg: "`📛` | *Hàng đợi đã:* `Cleared`" ##### On QueueEnd Event ##### @@ -60,3 +52,5 @@ leave_title: "Di chuyển" leave_desc: "*Tôi đã bị di chuyển, đã tự động ngắt kết nối*" player_end: "Ngắt kết nối kênh đàm thoại <#%{leave}> vì bạn để tôi có một mình à ;<" download_title: "Tải xuống:" +leave_pause: "`⏸️` | Nhạc đã bị tạm dừng vì tôi bị bỏ lại một mình." +leave_resume: "`▶️` | Âm nhạc đã được tiếp tục vì có người tham gia." diff --git a/src/manifest.xml b/src/manifest.xml index 033b7e22..ac5a12a1 100644 --- a/src/manifest.xml +++ b/src/manifest.xml @@ -7,7 +7,7 @@ - 4.1.1 + 4.1.2 4.2.0 hatsuharu (AzurLane) From a0e9f2fbb7226211f046173796b7517a750ac603 Mon Sep 17 00:00:00 2001 From: RainyXeon / Date: Thu, 28 Dec 2023 19:17:29 +0700 Subject: [PATCH 03/28] Add fallback for autoComplete, fix voiceStateUpdate --- src/commands/prefix/Music/Loop.ts | 16 ++++--- src/commands/slash/Music/Play.ts | 4 +- src/commands/slash/Playlist/Add.ts | 4 +- src/events/guild/voiceStateUpdate.ts | 62 +++++++++++++++++----------- 4 files changed, 53 insertions(+), 33 deletions(-) diff --git a/src/commands/prefix/Music/Loop.ts b/src/commands/prefix/Music/Loop.ts index 8cea9f6f..f8ff830f 100644 --- a/src/commands/prefix/Music/Loop.ts +++ b/src/commands/prefix/Music/Loop.ts @@ -62,11 +62,17 @@ export default class implements PrefixCommand { const mode = args[0]; if (!mode_array.includes(mode)) - return message.reply( - `${client.i18n.get(language, "music", "loop_invalid", { - mode: mode_array.join(", "), - })}` - ); + return msg.edit({ + embeds: [ + new EmbedBuilder() + .setDescription( + `${client.i18n.get(language, "music", "loop_invalid", { + mode: mode_array.join(", "), + })}` + ) + .setColor(client.color), + ], + }); if (mode == "song") { await player.setLoop(KazagumoLoop.track); diff --git a/src/commands/slash/Music/Play.ts b/src/commands/slash/Music/Play.ts index 35cb28c4..781bd184 100644 --- a/src/commands/slash/Music/Play.ts +++ b/src/commands/slash/Music/Play.ts @@ -249,8 +249,8 @@ export default class implements SlashCommand { for (let i = 0; i < 10; i++) { const x = searchRes.tracks[i]; choice.push({ - name: x.title ? x.title : "Unknown track name", - value: x.uri ? x.uri : url, + name: x && x.title ? x.title : "Unknown track name", + value: x && x.uri ? x.uri : url, }); } diff --git a/src/commands/slash/Playlist/Add.ts b/src/commands/slash/Playlist/Add.ts index 96b49039..5c3edea9 100644 --- a/src/commands/slash/Playlist/Add.ts +++ b/src/commands/slash/Playlist/Add.ts @@ -256,8 +256,8 @@ export default class implements SlashCommand { for (let i = 0; i < 10; i++) { const x = searchRes.tracks[i]; choice.push({ - name: x.title ? x.title : "Unknown track name", - value: x.uri ? x.uri : url, + name: x && x.title ? x.title : "Unknown track name", + value: x && x.uri ? x.uri : url, }); } diff --git a/src/events/guild/voiceStateUpdate.ts b/src/events/guild/voiceStateUpdate.ts index 98552c90..9665ccf3 100644 --- a/src/events/guild/voiceStateUpdate.ts +++ b/src/events/guild/voiceStateUpdate.ts @@ -62,21 +62,48 @@ export default class { const leaveEmbed = client.channels.cache.get(player.textId) as TextChannel; - const pauseStatus = !player.paused; - - player.pause(!player.paused); + if ( + newState.guild.members.me!.voice?.channel && + newState.guild.members.me!.voice.channel.members.filter( + (m) => !m.user.bot + ).size !== 0 + ) { + if (oldState.channelId) return; + if (oldState.channelId === newState.channelId) return; + // Resume player + player.pause(false); + const msg = await leaveEmbed.send({ + embeds: [ + new EmbedBuilder() + .setDescription( + `${client.i18n.get(language, "player", "leave_resume")}` + ) + .setColor(client.color), + ], + }); + setTimeout( + async () => msg.delete(), + client.config.bot.DELETE_MSG_TIMEOUT + ); + } - try { - if (leaveEmbed) { + if ( + oldState.guild.members.cache.get(client.user!.id)!.voice.channelId === + oldState.channelId + ) { + if ( + oldState.guild.members.me!.voice?.channel && + oldState.guild.members.me!.voice.channel.members.filter( + (m) => !m.user.bot + ).size === 0 + ) { + // Pause player + player.pause(true); const msg = await leaveEmbed.send({ embeds: [ new EmbedBuilder() .setDescription( - `${ - pauseStatus - ? client.i18n.get(language, "player", "leave_pause") - : client.i18n.get(language, "player", "leave_resume") - }` + `${client.i18n.get(language, "player", "leave_pause")}` ) .setColor(client.color), ], @@ -85,21 +112,8 @@ export default class { async () => msg.delete(), client.config.bot.DELETE_MSG_TIMEOUT ); - } - } catch (error) { - client.logger.error(error); - } - if ( - oldState.guild.members.cache.get(client.user!.id)!.voice.channelId === - oldState.channelId - ) { - if ( - oldState.guild.members.me!.voice?.channel && - oldState.guild.members.me!.voice.channel.members.filter( - (m) => !m.user.bot - ).size === 0 - ) { + // Delay leave timeout await delay(client.config.lavalink.LEAVE_TIMEOUT); const vcMembers = From 60cfa97e8d34089f775e1888a65c9641c8418fa6 Mon Sep 17 00:00:00 2001 From: RainyXeon / Date: Thu, 28 Dec 2023 19:54:12 +0700 Subject: [PATCH 04/28] Loop prettier --- src/commands/prefix/Music/Loop.ts | 10 +++++++++- src/languages/en/music.yaml | 2 +- src/languages/vi/music.yaml | 2 +- test.js | 3 +++ 4 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 test.js diff --git a/src/commands/prefix/Music/Loop.ts b/src/commands/prefix/Music/Loop.ts index f8ff830f..11ee309c 100644 --- a/src/commands/prefix/Music/Loop.ts +++ b/src/commands/prefix/Music/Loop.ts @@ -67,7 +67,7 @@ export default class implements PrefixCommand { new EmbedBuilder() .setDescription( `${client.i18n.get(language, "music", "loop_invalid", { - mode: mode_array.join(", "), + mode: this.changeBold(mode_array).join(", "), })}` ) .setColor(client.color), @@ -109,4 +109,12 @@ export default class implements PrefixCommand { await client.db.autoreconnect.set(`${player.guildId}.config.loop`, loop); } } + + changeBold(arrayMode: string[]) { + const res = []; + for (const data of arrayMode) { + res.push(`**${data}**`); + } + return res; + } } diff --git a/src/languages/en/music.yaml b/src/languages/en/music.yaml index ceb8f332..1420862e 100644 --- a/src/languages/en/music.yaml +++ b/src/languages/en/music.yaml @@ -32,7 +32,7 @@ stop_msg: "`👋` | **Bot has been:** `Disconnected`" ### Loop command! loop_loading: "Loading please wait..." -loop_invalid: "Invalid loop mode, only %{mode}" +loop_invalid: "⚠️ | You must specify a valid loop mode. Valid modes: %{mode}!" loop_current: "`🔁` | **Loop Mode:** `Current`" unloop_current: "`🔁` | **Song is unloop:** `Current`" loop_all: "`🔁` | **Loop Mode:** `Queue`" diff --git a/src/languages/vi/music.yaml b/src/languages/vi/music.yaml index adc64da0..438c8e45 100644 --- a/src/languages/vi/music.yaml +++ b/src/languages/vi/music.yaml @@ -26,7 +26,7 @@ stop_loading: "Đang tải, vui lòng chờ..." stop_msg: "`👋` | *Bot đã:* `Đã ngắt kết nối`" ### Loop command! loop_loading: "Đang tải, vui lòng chờ..." -loop_invalid: "Chế độ vòng lặp không hợp lệ, chỉ được phép sử dụng: %{mode}" +loop_invalid: "⚠️ | Bạn phải chọn chế độ vòng lặp hợp lệ. Chế độ hợp lệ: %{mode}!" loop_current: "`🔁` | *Chế độ vòng lặp:* `Hiện hành`" unloop_current: "`🔁` | *Nhạc được ngừng lặp lại ở chế độ:* `Bài hát hiện tại`" loop_all: "`🔁` | *Chế độ vòng lặp:* `Xếp hàng`" diff --git a/test.js b/test.js new file mode 100644 index 00000000..afdf9612 --- /dev/null +++ b/test.js @@ -0,0 +1,3 @@ +const mode_array = ["none", "song", "queue"]; + +console.log(...mode_array.forEach(data => { return mode_array.push()`**${data}**` })) \ No newline at end of file From 51465b719c0ef3a711d0f077e0d8b7cfa5a0aa42 Mon Sep 17 00:00:00 2001 From: RainyXeon / Date: Thu, 28 Dec 2023 20:13:50 +0700 Subject: [PATCH 05/28] Fix autoreconnect --- src/database/setup/lavalink.ts | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/src/database/setup/lavalink.ts b/src/database/setup/lavalink.ts index 0ae81c15..94d1e664 100644 --- a/src/database/setup/lavalink.ts +++ b/src/database/setup/lavalink.ts @@ -4,6 +4,8 @@ import { AutoReconnect } from "../schema/AutoReconnect.js"; import chillout from "chillout"; import { KazagumoLoopMode } from "../../@types/Lavalink.js"; import { KazagumoPlayer } from "kazagumo.mod"; +import { VoiceChannel } from "discord.js"; +import { AutoReconnectBuilder } from "../build/AutoReconnect.js"; export class AutoReconnectLavalinkService { client: Manager; @@ -70,12 +72,26 @@ export class AutoReconnectLavalinkService { } async connectChannel(data: { id: string; value: AutoReconnect }) { + const lavalink = chalk.hex("#ffc61c"); + const lavalink_mess = lavalink("Lavalink: "); const channel = this.client.channels.cache.get(data.value.text); - const voice = this.client.channels.cache.get(data.value.voice); + const voice = this.client.channels.cache.get( + data.value.voice + ) as VoiceChannel; if (!channel || !voice) { - this.client.db.autoreconnect.set(`${data.id}.text`, ""); - this.client.db.autoreconnect.set(`${data.id}.voice`, ""); - return; + this.client.logger.data_loader( + lavalink_mess + + `The last voice/text channel that bot joined in guild [${data.value.guild}] is not found, skipping...` + ); + return this.client.db.autoreconnect.delete(data.value.guild); + } + + if (voice.members.size == 0) { + this.client.logger.data_loader( + lavalink_mess + + `Guild [${data.value.guild}] have 0 members in last voice that bot joined, skipping...` + ); + return this.client.db.autoreconnect.delete(data.value.guild); } const player = await this.client.manager.createPlayer({ From 67afb1fb6a87e6983f20beb7d84ff3a1b5314ab8 Mon Sep 17 00:00:00 2001 From: RainyXeon / Date: Fri, 29 Dec 2023 08:56:22 +0700 Subject: [PATCH 06/28] Fix mp3 command and perm sys --- src/assets/radioLink.ts | 45 ---- src/commands/prefix/Music/File.ts | 17 +- src/commands/prefix/Music/Lofi.ts | 110 ---------- src/commands/prefix/Music/Radio.ts | 278 ------------------------- src/commands/prefix/Utils/Status.ts | 2 +- src/commands/slash/Music/File.ts | 45 ++-- src/commands/slash/Music/Lofi.ts | 107 ---------- src/commands/slash/Music/Radio.ts | 286 -------------------------- src/commands/slash/Utils/Status.ts | 2 +- src/events/guild/interactionCreate.ts | 181 ++++------------ src/events/guild/messageCreate.ts | 127 +++++++----- src/languages/en/interaction.yaml | 2 +- src/languages/vi/interaction.yaml | 2 +- 13 files changed, 148 insertions(+), 1056 deletions(-) delete mode 100644 src/assets/radioLink.ts delete mode 100644 src/commands/prefix/Music/Lofi.ts delete mode 100644 src/commands/prefix/Music/Radio.ts delete mode 100644 src/commands/slash/Music/Lofi.ts delete mode 100644 src/commands/slash/Music/Radio.ts diff --git a/src/assets/radioLink.ts b/src/assets/radioLink.ts deleted file mode 100644 index 297a0fd3..00000000 --- a/src/assets/radioLink.ts +++ /dev/null @@ -1,45 +0,0 @@ -export const Radiostations = [ - "Standard-Radio https://streams.ilovemusic.de/iloveradio14.mp3", - "Base-Radio.de https://baseradiode.stream.laut.fm/baseradiode", - "Chill-Radio https://streams.ilovemusic.de/iloveradio17.mp3", - "Dance-Radio https://streams.ilovemusic.de/iloveradio2.mp3", - "Deutsch-Rap-Radio https://streams.ilovemusic.de/iloveradio6.mp3", - "Greatest-hits-Radio https://streams.ilovemusic.de/iloveradio16.mp3", - "Hip-hop-Radio https://streams.ilovemusic.de/iloveradio3.mp3", - "Party-Radio https://streams.ilovemusic.de/iloveradio14.mp3", - "Us-Rap-Radio https://streams.ilovemusic.de/iloveradio13.mp3", - "X-Mas-Radio https://streams.ilovemusic.de/iloveradio8.mp3", - "Greatest-hits-Radio https://stream-mz.planetradio.co.uk/net2national.mp3", //britten - "Absolut-Radio http://icy-e-bab-02-gos.sharp-stream.com/absoluteradio.mp3", //britten - "Absolut-70s-Radio http://ais.absoluteradio.co.uk/absolute70s.mp3", //britten - "Absolut-80s-Radio http://ais.absoluteradio.co.uk/absolute80s.mp3", //britten - "Absolut-90s-Radio http://ais.absoluteradio.co.uk/absolute90s.mp3", //britten - "Absolut-2000s-Radio http://ais.absoluteradio.co.uk/absolute00s.mp3", //britten - "Absolut-Classic-Rock http://icy-e-bab-04-cr.sharp-stream.com/absoluteclassicrock.mp3", //britten - - "Top-Radio http://loadbalancing.topradio.be/topradio.mp3", //australia - - "88.6-Radio http://radio886.fluidstream.eu/886_live.mp3", //austria - "Kronehit-Radio http://onair.krone.at/kronehit.mp3", //austria - - "NRJ-Radio http://cdn.nrjaudio.fm/audio1/fr/30001/mp3_128.mp3", //france - "Radio-France-Radio http://direct.fipradio.fr/live/fip-midfi.mp3", //france - - "Rai-Radio http://icestreaming.rai.it:80/1.mp3", //italy - "Veronica-Radio http://icestreaming.rai.it:80/2.mp3", //italy - - "ERR-Radio http://icecast.err.ee:80/vikerraadio.mp3", //Estonia - "Tallin-Radio http://icecast.err.ee:80/raadiotallinn.mp3", //Estonia - - "Color-Music-Radio http://icecast8.play.cz/color128.mp3", //Spain - "Helax-93.7-Radio http://ice.abradio.cz:8000/helax128.mp3", //Spain - - "Český-rozhlas-Radio http://icecast6.play.cz/cro2-128.mp3", //Czech - "Spin-Radio http://icecast4.play.cz/spin128.mp3", //Czech - - "BB-Radio http://icecast.omroep.nl/radio1-bb-mp3", //netherlands - "538-Radio http://21223.live.streamtheworld.com/RADIO538.mp3", //netherlands - - "radio90-cieszyn http://streams2.radio90.pl:8000/radio90_128kbps_stereo.mp3", //Polska - "Fama-Radio http://stream2.nadaje.com:8076/,stream.mp3", //Polska -]; diff --git a/src/commands/prefix/Music/File.ts b/src/commands/prefix/Music/File.ts index e401cfd1..8c001a32 100644 --- a/src/commands/prefix/Music/File.ts +++ b/src/commands/prefix/Music/File.ts @@ -7,6 +7,8 @@ import { } from "discord.js"; import { Manager } from "../../../manager.js"; import { Accessableby, PrefixCommand } from "../../../@types/Command.js"; +import { StartQueueDuration } from "../../../structures/QueueDuration.js"; +import { ConvertTime } from "../../../structures/ConvertTime.js"; // Main code export default class implements PrefixCommand { @@ -46,10 +48,7 @@ export default class implements PrefixCommand { }); const { channel } = message.member!.voice; - if ( - !channel || - message.member!.voice.channel !== message.guild!.members.me!.voice.channel - ) + if (!channel) return msg.edit({ embeds: [ new EmbedBuilder() @@ -112,6 +111,8 @@ export default class implements PrefixCommand { for (let track of tracks) player.queue.add(track); else player.play(tracks[0]); + const TotalDuration = new StartQueueDuration().parse(tracks); + await message.delete(); if (result.type === "PLAYLIST") { @@ -120,7 +121,9 @@ export default class implements PrefixCommand { `${client.i18n.get(language, "music", "play_playlist", { title: file.name, url: file.url, - length: String(tracks.length), + duration: new ConvertTime().parse(TotalDuration), + songs: String(tracks.length), + request: String(tracks[0].requester), })}` ) .setColor(client.color); @@ -132,6 +135,8 @@ export default class implements PrefixCommand { `${client.i18n.get(language, "music", "play_track", { title: file.name, url: file.url, + duration: new ConvertTime().parse(tracks[0].length as number), + request: String(tracks[0].requester), })}` ) .setColor(client.color); @@ -142,6 +147,8 @@ export default class implements PrefixCommand { `${client.i18n.get(language, "music", "play_result", { title: file.name, url: file.url, + duration: new ConvertTime().parse(tracks[0].length as number), + request: String(tracks[0].requester), })}` ); msg.edit({ content: " ", embeds: [embed] }); diff --git a/src/commands/prefix/Music/Lofi.ts b/src/commands/prefix/Music/Lofi.ts deleted file mode 100644 index 497d2240..00000000 --- a/src/commands/prefix/Music/Lofi.ts +++ /dev/null @@ -1,110 +0,0 @@ -import { EmbedBuilder, Message, PermissionsBitField } from "discord.js"; -import { ConvertTime } from "../../../structures/ConvertTime.js"; -import { StartQueueDuration } from "../../../structures/QueueDuration.js"; -import { Manager } from "../../../manager.js"; -import { Accessableby, PrefixCommand } from "../../../@types/Command.js"; - -export default class implements PrefixCommand { - name = "lofi"; - description = "Play a lofi radio station"; - category = "Music"; - usage = ""; - aliases = []; - lavalink = true; - accessableby = Accessableby.Member; - - async run( - client: Manager, - message: Message, - args: string[], - language: string, - prefix: string - ) { - const msg = await message.reply({ - embeds: [ - new EmbedBuilder() - .setDescription( - `${client.i18n.get(language, "music", "radio_loading")}` - ) - .setColor(client.color), - ], - }); - const value = "http://stream.laut.fm/lofi.m3u"; - - const { channel } = message.member!.voice; - if (!channel) - return msg.edit({ - embeds: [ - new EmbedBuilder() - .setDescription( - `${client.i18n.get(language, "music", "radio_invoice")}` - ) - .setColor(client.color), - ], - }); - - const player = await client.manager.createPlayer({ - guildId: message.guild!.id, - voiceId: message.member!.voice.channel!.id, - textId: message.channel.id, - deaf: true, - }); - - const result = await player.search(value, { requester: message.author }); - const tracks = result.tracks; - - if (!result.tracks.length) - return msg.edit({ - embeds: [ - new EmbedBuilder() - .setDescription( - `${client.i18n.get(language, "music", "radio_match")}` - ) - .setColor(client.color), - ], - }); - if (result.type === "PLAYLIST") - for (let track of tracks) player.queue.add(track); - else player.play(tracks[0]); - - const TotalDuration = new StartQueueDuration().parse(tracks); - - if (result.type === "PLAYLIST") { - const embed = new EmbedBuilder() - .setDescription( - `${client.i18n.get(language, "music", "play_playlist", { - title: tracks[0].title, - url: value, - duration: new ConvertTime().parse(TotalDuration), - songs: String(tracks.length), - request: String(tracks[0].requester), - })}` - ) - .setColor(client.color); - msg.edit({ content: " ", embeds: [embed] }); - if (!player.playing) player.play(); - } else if (result.type === "TRACK") { - const embed = new EmbedBuilder() - .setDescription( - `${client.i18n.get(language, "music", "radio_track", { - title: tracks[0].title, - url: String(tracks[0].uri), - duration: new ConvertTime().parse(tracks[0].length as number), - request: String(tracks[0].requester), - })}` - ) - .setColor(client.color); - msg.edit({ content: " ", embeds: [embed] }); - } else if (result.type === "SEARCH") { - const embed = new EmbedBuilder().setColor(client.color).setDescription( - `${client.i18n.get(language, "music", "play_result", { - title: tracks[0].title, - url: String(tracks[0].uri), - duration: new ConvertTime().parse(tracks[0].length as number), - request: String(tracks[0].requester), - })}` - ); - msg.edit({ content: " ", embeds: [embed] }); - } - } -} diff --git a/src/commands/prefix/Music/Radio.ts b/src/commands/prefix/Music/Radio.ts deleted file mode 100644 index ce9b5e33..00000000 --- a/src/commands/prefix/Music/Radio.ts +++ /dev/null @@ -1,278 +0,0 @@ -import { EmbedBuilder, Message, PermissionsBitField } from "discord.js"; -import { Radiostations } from "../../../assets/radioLink.js"; -import { ConvertTime } from "../../../structures/ConvertTime.js"; -import { Manager } from "../../../manager.js"; -import { Accessableby, PrefixCommand } from "../../../@types/Command.js"; -// Main code -export default class implements PrefixCommand { - name = "radio"; - description = "Play radio in voice channel"; - category = "Music"; - usage = ""; - aliases = []; - lavalink = true; - accessableby = Accessableby.Member; - - async run( - client: Manager, - message: Message, - args: string[], - language: string, - prefix: string - ) { - const msg = await message.reply({ - embeds: [ - new EmbedBuilder() - .setDescription( - `${client.i18n.get(language, "music", "radio_loading")}` - ) - .setColor(client.color), - ], - }); - - const value = args[0]; - if (value && isNaN(+value)) - return msg.edit( - `${client.i18n.get(language, "music", "number_invalid")}` - ); - - const { channel } = message.member!.voice; - if (!channel) - return msg.edit({ - embeds: [ - new EmbedBuilder() - .setDescription( - `${client.i18n.get(language, "noplayer", "no_voice")}` - ) - .setColor(client.color), - ], - }); - - const resultsEmbed = new EmbedBuilder() - .setTitle(`${client.i18n.get(language, "radio", "available_radio")}`) // - .addFields([ - { - name: `${client.i18n.get(language, "radio", "standard_radio")}`, - value: `**1: ** [\`${Radiostations[1 - 1].split(" ")[0]}\`](${ - Radiostations[1 - 1].split(" ")[1] - }) - **2: ** [\`${Radiostations[2 - 1].split(" ")[0]}\`](${ - Radiostations[2 - 1].split(" ")[1] - }) - **3: ** [\`${Radiostations[3 - 1].split(" ")[0]}\`](${ - Radiostations[3 - 1].split(" ")[1] - }) - **4: ** [\`${Radiostations[4 - 1].split(" ")[0]}\`](${ - Radiostations[4 - 1].split(" ")[1] - }) - **5: ** [\`${Radiostations[5 - 1].split(" ")[0]}\`](${ - Radiostations[5 - 1].split(" ")[1] - }) - `, - inline: true, - }, - { - name: `${client.i18n.get(language, "radio", "standard_radio")}`, - value: `**6: ** [\`${Radiostations[6 - 1].split(" ")[0]}\`](${ - Radiostations[6 - 1].split(" ")[1] - }) - **7: ** [\`${Radiostations[7 - 1].split(" ")[0]}\`](${ - Radiostations[7 - 1].split(" ")[1] - }) - **8: ** [\`${Radiostations[8 - 1].split(" ")[0]}\`](${ - Radiostations[8 - 1].split(" ")[1] - }) - **9: ** [\`${Radiostations[9 - 1].split(" ")[0]}\`](${ - Radiostations[9 - 1].split(" ")[1] - }) - **10: ** [\`${Radiostations[10 - 1].split(" ")[0]}\`](${ - Radiostations[10 - 1].split(" ")[1] - }) - `, - inline: true, - }, - { name: `\u200b`, value: `\u200b`, inline: true }, - - { - name: `***🇬🇧 British RADIO:***`, - value: `**11: ** [\`${Radiostations[11 - 1].split(" ")[0]}\`](${ - Radiostations[11 - 1].split(" ")[1] - }) - **12: ** [\`${Radiostations[12 - 1].split(" ")[0]}\`](${ - Radiostations[12 - 1].split(" ")[1] - }) - `, - inline: true, - }, - { - name: `***🇬🇧 British RADIO:***`, - value: ` - **13: ** [\`${Radiostations[13 - 1].split(" ")[0]}\`](${ - Radiostations[13 - 1].split(" ")[1] - }) - **14: ** [\`${Radiostations[14 - 1].split(" ")[0]}\`](${ - Radiostations[14 - 1].split(" ")[1] - }) - `, - inline: true, - }, - { - name: `***🇬🇧 British RADIO:***`, - value: ` - **15: ** [\`${Radiostations[15 - 1].split(" ")[0]}\`](${ - Radiostations[15 - 1].split(" ")[1] - }) - **16: ** [\`${Radiostations[16 - 1].split(" ")[0]}\`](${ - Radiostations[16 - 1].split(" ")[1] - }) - `, - inline: true, - }, - - { - name: `***🇦🇺 AUSTRALIA RADIO:***`, - value: `**17: ** [\`${Radiostations[17 - 1].split(" ")[0]}\`](${ - Radiostations[17 - 1].split(" ")[1] - }) - **18: ** [\`${Radiostations[18 - 1].split(" ")[0]}\`](${ - Radiostations[18 - 1].split(" ")[1] - })`, - inline: true, - }, - - { - name: `***🇦🇹 AUSTRIA RADIO:***`, - value: `**19: ** [\`${Radiostations[19 - 1].split(" ")[0]}\`](${ - Radiostations[19 - 1].split(" ")[1] - }) - **20: ** [\`${Radiostations[20 - 1].split(" ")[0]}\`](${ - Radiostations[20 - 1].split(" ")[1] - })`, - inline: true, - }, - - { - name: `***🇫🇷 France RADIO:***`, - value: ` **21: ** [\`${Radiostations[21 - 1].split(" ")[0]}\`](${ - Radiostations[21 - 1].split(" ")[1] - }) - **22: ** [\`${Radiostations[22 - 1].split(" ")[0]}\`](${ - Radiostations[22 - 1].split(" ")[1] - })`, - inline: true, - }, - - { - name: `***🇮🇹 Italy RADIO:***`, - value: `**23: ** [\`${Radiostations[23 - 1].split(" ")[0]}\`](${ - Radiostations[23 - 1].split(" ")[1] - }) - **24: ** [\`${Radiostations[24 - 1].split(" ")[0]}\`](${ - Radiostations[24 - 1].split(" ")[1] - })`, - inline: true, - }, - - { - name: `***🇪🇪 Estonia RADIO:***`, - value: `**25: ** [\`${Radiostations[25 - 1].split(" ")[0]}\`](${ - Radiostations[25 - 1].split(" ")[1] - }) - **26: ** [\`${Radiostations[26 - 1].split(" ")[0]}\`](${ - Radiostations[26 - 1].split(" ")[1] - })`, - inline: true, - }, - - { - name: `***🇪🇸 Spain RADIO:***`, - value: `**27: ** [\`${Radiostations[27 - 1].split(" ")[0]}\`](${ - Radiostations[27 - 1].split(" ")[1] - }) - **28: ** [\`${Radiostations[28 - 1].split(" ")[0]}\`](${ - Radiostations[28 - 1].split(" ")[1] - })`, - inline: true, - }, - - { - name: `***🇨🇿 Czech RADIO:***`, - value: `**29: ** [\`${Radiostations[29 - 1].split(" ")[0]}\`](${ - Radiostations[29 - 1].split(" ")[1] - }) - **30: ** [\`${Radiostations[30 - 1].split(" ")[0]}\`](${ - Radiostations[30 - 1].split(" ")[1] - })`, - inline: true, - }, - - { - name: `***🇳🇱 Netherlands RADIO:***`, - value: `**31: ** [\`${Radiostations[31 - 1].split(" ")[0]}\`](${ - Radiostations[31 - 1].split(" ")[1] - }) - **32: ** [\`${Radiostations[32 - 1].split(" ")[0]}\`](${ - Radiostations[32 - 1].split(" ")[1] - })`, - inline: true, - }, - - { - name: `***🇵🇱 Polska RADIO:***`, - value: `**33: ** [\`${Radiostations[33 - 1].split(" ")[0]}\`](${ - Radiostations[33 - 1].split(" ")[1] - }) - **34: ** [\`${Radiostations[34 - 1].split(" ")[0]}\`](${ - Radiostations[34 - 1].split(" ")[1] - })`, - inline: true, - }, - ]) - .setColor(client.color) - .setFooter({ text: `/radio <1-34>` }) - .setTimestamp(); - - if (!value) { - return msg.edit({ content: " ", embeds: [resultsEmbed] }); - } else if (Number(value) > 34 || Number(value) < 0) { - return msg.edit({ content: " ", embeds: [resultsEmbed] }); - } - - const player = await client.manager.createPlayer({ - guildId: message.guild!.id, - voiceId: message.member!.voice.channel!.id, - textId: message.channel.id, - deaf: true, - }); - - let i; - - for (i = 1; i <= 1 + Radiostations.length; i++) { - if (Number(value) === Number(i)) { - break; - } - } - - const args2 = Radiostations[i - 1].split(` `); - - const song = args2[1]; - - const res = await player.search(song, { requester: message.author }); - - if (res.type == "TRACK") { - player.queue.add(res.tracks[0]); - const embed = new EmbedBuilder() - .setDescription( - `${client.i18n.get(language, "music", "play_track", { - title: args2[0], - url: String(res.tracks[0].uri), - duration: new ConvertTime().parse(res.tracks[0].length as number), - request: String(res.tracks[0].requester), - })}` - ) - .setColor(client.color); - msg.edit({ content: " ", embeds: [embed] }); - if (!player.playing) player.play(); - } - } -} diff --git a/src/commands/prefix/Utils/Status.ts b/src/commands/prefix/Utils/Status.ts index 486b652b..62e41450 100644 --- a/src/commands/prefix/Utils/Status.ts +++ b/src/commands/prefix/Utils/Status.ts @@ -9,7 +9,7 @@ export default class implements PrefixCommand { name = "status-channel"; description = "Create bot status channel"; category = "Utils"; - accessableby = Accessableby.Manager; + accessableby = Accessableby.Owner; aliases = ["sc"]; usage = ""; lavalink = false; diff --git a/src/commands/slash/Music/File.ts b/src/commands/slash/Music/File.ts index 8f2ce603..cd5a04cd 100644 --- a/src/commands/slash/Music/File.ts +++ b/src/commands/slash/Music/File.ts @@ -8,6 +8,8 @@ import { } from "discord.js"; import { Manager } from "../../../manager.js"; import { Accessableby, SlashCommand } from "../../../@types/Command.js"; +import { ConvertTime } from "../../../structures/ConvertTime.js"; +import { StartQueueDuration } from "../../../structures/QueueDuration.js"; // Main code export default class implements SlashCommand { @@ -29,6 +31,7 @@ export default class implements SlashCommand { client: Manager, language: string ) { + let player; await interaction.deferReply({ ephemeral: false }); const file = await ( @@ -44,23 +47,8 @@ export default class implements SlashCommand { ], }); - let player = client.manager.players.get(interaction.guild!.id); - if (!player) - return msg.edit({ - embeds: [ - new EmbedBuilder() - .setDescription( - `${client.i18n.get(language, "noplayer", "no_player")}` - ) - .setColor(client.color), - ], - }); const { channel } = (interaction.member as GuildMember)!.voice; - if ( - !channel || - (interaction.member as GuildMember)!.voice.channel !== - interaction.guild!.members.me!.voice.channel - ) + if (!channel) return msg.edit({ embeds: [ new EmbedBuilder() @@ -70,20 +58,7 @@ export default class implements SlashCommand { .setColor(client.color), ], }); - if ( - !interaction - .guild!.members.cache.get(client.user!.id)! - .permissions.has(PermissionsBitField.Flags.Speak) - ) - return msg.edit({ - embeds: [ - new EmbedBuilder() - .setDescription( - `${client.i18n.get(language, "music", "play_speak")}` - ) - .setColor(client.color), - ], - }); + if (file!.contentType !== "audio/mpeg" && file!.contentType !== "audio/ogg") return msg.edit({ embeds: [ @@ -136,13 +111,17 @@ export default class implements SlashCommand { for (let track of tracks) player.queue.add(track); else player.play(tracks[0]); + const TotalDuration = new StartQueueDuration().parse(tracks); + if (result.type === "PLAYLIST") { const embed = new EmbedBuilder() .setDescription( `${client.i18n.get(language, "music", "play_playlist", { title: file!.name, url: String(file?.proxyURL), - length: String(tracks.length), + duration: new ConvertTime().parse(TotalDuration), + songs: String(tracks.length), + request: String(tracks[0].requester), })}` ) .setColor(client.color); @@ -154,6 +133,8 @@ export default class implements SlashCommand { `${client.i18n.get(language, "music", "play_track", { title: file!.name, url: String(file?.proxyURL), + duration: new ConvertTime().parse(tracks[0].length as number), + request: String(tracks[0].requester), })}` ) .setColor(client.color); @@ -164,6 +145,8 @@ export default class implements SlashCommand { `${client.i18n.get(language, "music", "play_result", { title: file!.name, url: String(file?.proxyURL), + duration: new ConvertTime().parse(tracks[0].length as number), + request: String(tracks[0].requester), })}` ); msg.edit({ content: " ", embeds: [embed] }); diff --git a/src/commands/slash/Music/Lofi.ts b/src/commands/slash/Music/Lofi.ts deleted file mode 100644 index 679f465a..00000000 --- a/src/commands/slash/Music/Lofi.ts +++ /dev/null @@ -1,107 +0,0 @@ -import { - EmbedBuilder, - PermissionsBitField, - CommandInteraction, - GuildMember, -} from "discord.js"; -import { ConvertTime } from "../../../structures/ConvertTime.js"; -import { StartQueueDuration } from "../../../structures/QueueDuration.js"; -import { Manager } from "../../../manager.js"; -import { Accessableby, SlashCommand } from "../../../@types/Command.js"; -const value = "http://stream.laut.fm/lofi.m3u"; - -export default class implements SlashCommand { - name = ["lofi"]; - description = "Play a lofi radio station"; - category = "Music"; - accessableby = Accessableby.Member; - lavalink = true; - options = []; - - async run( - interaction: CommandInteraction, - client: Manager, - language: string - ) { - await interaction.deferReply({ ephemeral: false }); - const msg = await interaction.editReply({ - embeds: [ - new EmbedBuilder() - .setDescription( - `${client.i18n.get(language, "music", "radio_loading")}` - ) - .setColor(client.color), - ], - }); - - const { channel } = (interaction.member as GuildMember)!.voice; - if (!channel) - return msg.edit({ - embeds: [ - new EmbedBuilder() - .setDescription( - `${client.i18n.get(language, "noplayer", "no_voice")}` - ) - .setColor(client.color), - ], - }); - - const player = await client.manager.createPlayer({ - guildId: interaction.guild!.id, - voiceId: (interaction.member as GuildMember).voice.channel!.id, - textId: interaction.channel!.id, - deaf: true, - }); - - const result = await player.search(value, { requester: interaction.user }); - const tracks = result.tracks; - - if (!result.tracks.length) - return msg.edit({ - content: `${client.i18n.get(language, "music", "radio_match")}`, - }); - if (result.type === "PLAYLIST") - for (let track of tracks) player.queue.add(track); - else player.play(tracks[0]); - - const TotalDuration = new StartQueueDuration().parse(tracks); - - if (result.type === "PLAYLIST") { - const embed = new EmbedBuilder() - .setDescription( - `${client.i18n.get(language, "music", "play_playlist", { - title: tracks[0].title, - url: value, - duration: new ConvertTime().parse(TotalDuration), - songs: String(tracks.length), - request: String(tracks[0].requester), - })}` - ) - .setColor(client.color); - msg.edit({ content: " ", embeds: [embed] }); - if (!player.playing) player.play(); - } else if (result.type === "TRACK") { - const embed = new EmbedBuilder() - .setDescription( - `${client.i18n.get(language, "music", "radio_track", { - title: tracks[0].title, - url: String(tracks[0].uri), - duration: new ConvertTime().parse(tracks[0].length as number), - request: String(tracks[0].requester), - })}` - ) - .setColor(client.color); - msg.edit({ content: " ", embeds: [embed] }); - } else if (result.type === "SEARCH") { - const embed = new EmbedBuilder().setColor(client.color).setDescription( - `${client.i18n.get(language, "music", "play_result", { - title: tracks[0].title, - url: String(tracks[0].uri), - duration: new ConvertTime().parse(tracks[0].length as number), - request: String(tracks[0].requester), - })}` - ); - msg.edit({ content: " ", embeds: [embed] }); - } - } -} diff --git a/src/commands/slash/Music/Radio.ts b/src/commands/slash/Music/Radio.ts deleted file mode 100644 index ff6506fd..00000000 --- a/src/commands/slash/Music/Radio.ts +++ /dev/null @@ -1,286 +0,0 @@ -import { - EmbedBuilder, - CommandInteraction, - CommandInteractionOptionResolver, - GuildMember, - PermissionsBitField, -} from "discord.js"; -import { Radiostations } from "../../../assets/radioLink.js"; -import { ConvertTime } from "../../../structures/ConvertTime.js"; -import { Manager } from "../../../manager.js"; -import { Accessableby, SlashCommand } from "../../../@types/Command.js"; -// Main code -export default class implements SlashCommand { - name = ["radio"]; - description = "Play radio in voice channel"; - category = "Music"; - accessableby = Accessableby.Member; - lavalink = false; - options = [ - { - name: "number", - description: "The number of radio to choose the radio station", - type: 4, - required: false, - }, - ]; - - async run( - interaction: CommandInteraction, - client: Manager, - language: string - ) { - await interaction.deferReply({ ephemeral: false }); - const value = ( - interaction.options as CommandInteractionOptionResolver - ).getInteger("number"); - const msg = await interaction.editReply({ - embeds: [ - new EmbedBuilder() - .setDescription( - `${client.i18n.get(language, "music", "radio_loading")}` - ) - .setColor(client.color), - ], - }); - - const { channel } = (interaction.member as GuildMember)!.voice; - if (!channel) - return msg.edit({ - embeds: [ - new EmbedBuilder() - .setDescription( - `${client.i18n.get(language, "noplayer", "no_voice")}` - ) - .setColor(client.color), - ], - }); - - const resultsEmbed = new EmbedBuilder() - .setTitle(`${client.i18n.get(language, "radio", "available_radio")}`) // - .addFields([ - { - name: `${client.i18n.get(language, "radio", "standard_radio")}`, - value: `**1: ** [\`${Radiostations[1 - 1].split(" ")[0]}\`](${ - Radiostations[1 - 1].split(" ")[1] - }) - **2: ** [\`${Radiostations[2 - 1].split(" ")[0]}\`](${ - Radiostations[2 - 1].split(" ")[1] - }) - **3: ** [\`${Radiostations[3 - 1].split(" ")[0]}\`](${ - Radiostations[3 - 1].split(" ")[1] - }) - **4: ** [\`${Radiostations[4 - 1].split(" ")[0]}\`](${ - Radiostations[4 - 1].split(" ")[1] - }) - **5: ** [\`${Radiostations[5 - 1].split(" ")[0]}\`](${ - Radiostations[5 - 1].split(" ")[1] - }) - `, - inline: true, - }, - { - name: `${client.i18n.get(language, "radio", "standard_radio")}`, - value: `**6: ** [\`${Radiostations[6 - 1].split(" ")[0]}\`](${ - Radiostations[6 - 1].split(" ")[1] - }) - **7: ** [\`${Radiostations[7 - 1].split(" ")[0]}\`](${ - Radiostations[7 - 1].split(" ")[1] - }) - **8: ** [\`${Radiostations[8 - 1].split(" ")[0]}\`](${ - Radiostations[8 - 1].split(" ")[1] - }) - **9: ** [\`${Radiostations[9 - 1].split(" ")[0]}\`](${ - Radiostations[9 - 1].split(" ")[1] - }) - **10: ** [\`${Radiostations[10 - 1].split(" ")[0]}\`](${ - Radiostations[10 - 1].split(" ")[1] - }) - `, - inline: true, - }, - { name: `\u200b`, value: `\u200b`, inline: true }, - - { - name: `***🇬🇧 British RADIO:***`, - value: `**11: ** [\`${Radiostations[11 - 1].split(" ")[0]}\`](${ - Radiostations[11 - 1].split(" ")[1] - }) - **12: ** [\`${Radiostations[12 - 1].split(" ")[0]}\`](${ - Radiostations[12 - 1].split(" ")[1] - }) - `, - inline: true, - }, - { - name: `***🇬🇧 British RADIO:***`, - value: ` - **13: ** [\`${Radiostations[13 - 1].split(" ")[0]}\`](${ - Radiostations[13 - 1].split(" ")[1] - }) - **14: ** [\`${Radiostations[14 - 1].split(" ")[0]}\`](${ - Radiostations[14 - 1].split(" ")[1] - }) - `, - inline: true, - }, - { - name: `***🇬🇧 British RADIO:***`, - value: ` - **15: ** [\`${Radiostations[15 - 1].split(" ")[0]}\`](${ - Radiostations[15 - 1].split(" ")[1] - }) - **16: ** [\`${Radiostations[16 - 1].split(" ")[0]}\`](${ - Radiostations[16 - 1].split(" ")[1] - }) - `, - inline: true, - }, - - { - name: `***🇦🇺 AUSTRALIA RADIO:***`, - value: `**17: ** [\`${Radiostations[17 - 1].split(" ")[0]}\`](${ - Radiostations[17 - 1].split(" ")[1] - }) - **18: ** [\`${Radiostations[18 - 1].split(" ")[0]}\`](${ - Radiostations[18 - 1].split(" ")[1] - })`, - inline: true, - }, - - { - name: `***🇦🇹 AUSTRIA RADIO:***`, - value: `**19: ** [\`${Radiostations[19 - 1].split(" ")[0]}\`](${ - Radiostations[19 - 1].split(" ")[1] - }) - **20: ** [\`${Radiostations[20 - 1].split(" ")[0]}\`](${ - Radiostations[20 - 1].split(" ")[1] - })`, - inline: true, - }, - - { - name: `***🇫🇷 France RADIO:***`, - value: ` **21: ** [\`${Radiostations[21 - 1].split(" ")[0]}\`](${ - Radiostations[21 - 1].split(" ")[1] - }) - **22: ** [\`${Radiostations[22 - 1].split(" ")[0]}\`](${ - Radiostations[22 - 1].split(" ")[1] - })`, - inline: true, - }, - - { - name: `***🇮🇹 Italy RADIO:***`, - value: `**23: ** [\`${Radiostations[23 - 1].split(" ")[0]}\`](${ - Radiostations[23 - 1].split(" ")[1] - }) - **24: ** [\`${Radiostations[24 - 1].split(" ")[0]}\`](${ - Radiostations[24 - 1].split(" ")[1] - })`, - inline: true, - }, - - { - name: `***🇪🇪 Estonia RADIO:***`, - value: `**25: ** [\`${Radiostations[25 - 1].split(" ")[0]}\`](${ - Radiostations[25 - 1].split(" ")[1] - }) - **26: ** [\`${Radiostations[26 - 1].split(" ")[0]}\`](${ - Radiostations[26 - 1].split(" ")[1] - })`, - inline: true, - }, - - { - name: `***🇪🇸 Spain RADIO:***`, - value: `**27: ** [\`${Radiostations[27 - 1].split(" ")[0]}\`](${ - Radiostations[27 - 1].split(" ")[1] - }) - **28: ** [\`${Radiostations[28 - 1].split(" ")[0]}\`](${ - Radiostations[28 - 1].split(" ")[1] - })`, - inline: true, - }, - - { - name: `***🇨🇿 Czech RADIO:***`, - value: `**29: ** [\`${Radiostations[29 - 1].split(" ")[0]}\`](${ - Radiostations[29 - 1].split(" ")[1] - }) - **30: ** [\`${Radiostations[30 - 1].split(" ")[0]}\`](${ - Radiostations[30 - 1].split(" ")[1] - })`, - inline: true, - }, - - { - name: `***🇳🇱 Netherlands RADIO:***`, - value: `**31: ** [\`${Radiostations[31 - 1].split(" ")[0]}\`](${ - Radiostations[31 - 1].split(" ")[1] - }) - **32: ** [\`${Radiostations[32 - 1].split(" ")[0]}\`](${ - Radiostations[32 - 1].split(" ")[1] - })`, - inline: true, - }, - - { - name: `***🇵🇱 Polska RADIO:***`, - value: `**33: ** [\`${Radiostations[33 - 1].split(" ")[0]}\`](${ - Radiostations[33 - 1].split(" ")[1] - }) - **34: ** [\`${Radiostations[34 - 1].split(" ")[0]}\`](${ - Radiostations[34 - 1].split(" ")[1] - })`, - inline: true, - }, - ]) - .setColor(client.color) - .setFooter({ text: `/radio <1-34>` }) - .setTimestamp(); - - if (!value) { - return msg.edit({ content: " ", embeds: [resultsEmbed] }); - } else if (Number(value) > 34 || Number(value) < 0) { - return msg.edit({ content: " ", embeds: [resultsEmbed] }); - } - - const player = await client.manager.createPlayer({ - guildId: interaction.guild!.id, - voiceId: (interaction.member as GuildMember).voice.channel!.id, - textId: interaction.channel!.id, - deaf: true, - }); - - let i; - - for (i = 1; i <= 1 + Radiostations.length; i++) { - if (Number(value) === Number(i)) { - break; - } - } - - const args2 = Radiostations[i - 1].split(` `); - - const song = args2[1]; - - const res = await player.search(song, { requester: interaction.user }); - - if (res.type == "TRACK") { - player.queue.add(res.tracks[0]); - const embed = new EmbedBuilder() - .setDescription( - `${client.i18n.get(language, "music", "play_track", { - title: args2[0], - url: String(res.tracks[0].uri), - duration: new ConvertTime().parse(res.tracks[0].length as number), - request: String(res.tracks[0].requester), - })}` - ) - .setColor(client.color); - msg.edit({ content: " ", embeds: [embed] }); - if (!player.playing) player.play(); - } - } -} diff --git a/src/commands/slash/Utils/Status.ts b/src/commands/slash/Utils/Status.ts index 00a40efd..c17fea32 100644 --- a/src/commands/slash/Utils/Status.ts +++ b/src/commands/slash/Utils/Status.ts @@ -16,7 +16,7 @@ export default class implements SlashCommand { name = ["settings", "status"]; description = "Create bot status channel"; category = "Utils"; - accessableby = Accessableby.Manager; + accessableby = Accessableby.Owner; lavalink = false; options = [ { diff --git a/src/events/guild/interactionCreate.ts b/src/events/guild/interactionCreate.ts index 0e62fe87..ec306c0e 100644 --- a/src/events/guild/interactionCreate.ts +++ b/src/events/guild/interactionCreate.ts @@ -107,177 +107,72 @@ export default class { client.logger.info(`${msg_cmd.join(" ")}`); if ( - command.accessableby == Accessableby.Owner && - interaction.user.id != client.owner - ) - return (interaction as NoAutoInteraction).reply( - `${client.i18n.get(language, "interaction", "owner_only")}` - ); - - try { - if (command.accessableby == Accessableby.Premium) { - const user = client.premiums.get(interaction.user.id); - if (!user || !user.isPremium) { - const embed = new EmbedBuilder() - .setAuthor({ - name: `${client.i18n.get( - language, - "nopremium", - "premium_author" - )}`, - iconURL: client.user!.displayAvatarURL(), - }) - .setDescription( - `${client.i18n.get(language, "nopremium", "premium_desc")}` - ) - .setColor(client.color) - .setTimestamp(); - - return (interaction as NoAutoInteraction).reply({ - content: " ", - embeds: [embed], - }); - } - } - } catch (err) { - client.logger.error(err); - return (interaction as NoAutoInteraction).reply({ - content: `${client.i18n.get(language, "nopremium", "premium_error")}`, - }); - } - - if ( - !interaction.guild.members.me!.permissions.has( - PermissionsBitField.Flags.SendMessages + command.accessableby == Accessableby.Manager && + !(interaction.member!.permissions as Readonly).has( + PermissionsBitField.Flags.ManageGuild ) ) - return interaction.user.dmChannel!.send({ + return (interaction as NoAutoInteraction).reply({ embeds: [ new EmbedBuilder() .setDescription( - `${client.i18n.get(language, "interaction", "no_perms")}` + `${client.i18n.get(language, "utilities", "lang_perm")}` ) .setColor(client.color), ], }); - if ( - !interaction.guild.members.me!.permissions.has( - PermissionsBitField.Flags.ViewChannel - ) - ) - return; - if ( - !interaction.guild.members.me!.permissions.has( - PermissionsBitField.Flags.EmbedLinks - ) - ) + + if (command.lavalink && client.lavalinkUsing.length == 0) { return (interaction as NoAutoInteraction).reply({ embeds: [ new EmbedBuilder() .setDescription( - `${client.i18n.get(language, "interaction", "no_perms")}` + `${client.i18n.get(language, "music", "no_node")}` ) .setColor(client.color), ], }); - if (!((interaction as CommandInteraction).commandName == "help")) { - if ( - !interaction.guild.members.me!.permissions.has( - PermissionsBitField.Flags.Speak - ) - ) - return (interaction as NoAutoInteraction).reply({ - embeds: [ - new EmbedBuilder() - .setDescription( - `${client.i18n.get(language, "interaction", "no_perms")}` - ) - .setColor(client.color), - ], - }); - if ( - !interaction.guild.members.me!.permissions.has( - PermissionsBitField.Flags.Connect - ) - ) - return (interaction as NoAutoInteraction).reply({ - embeds: [ - new EmbedBuilder() - .setDescription( - `${client.i18n.get(language, "interaction", "no_perms")}` - ) - .setColor(client.color), - ], - }); - if ( - !interaction.guild.members.me!.permissions.has( - PermissionsBitField.Flags.ManageMessages - ) - ) - return (interaction as NoAutoInteraction).reply({ - embeds: [ - new EmbedBuilder() - .setDescription( - `${client.i18n.get(language, "interaction", "no_perms")}` - ) - .setColor(client.color), - ], - }); - if ( - !interaction.guild.members.me!.permissions.has( - PermissionsBitField.Flags.ManageChannels - ) - ) - return await (interaction as NoAutoInteraction).reply({ - embeds: [ - new EmbedBuilder() - .setDescription( - `${client.i18n.get(language, "interaction", "no_perms")}` - ) - .setColor(client.color), - ], - }); } if ( - command.accessableby == Accessableby.Manager && - !(interaction.member!.permissions as Readonly).has( - PermissionsBitField.Flags.ManageGuild - ) + command.accessableby == Accessableby.Owner && + interaction.user.id != client.owner ) return (interaction as NoAutoInteraction).reply( - `${client.i18n.get(language, "utilities", "lang_perm")}` + `${client.i18n.get(language, "interaction", "owner_only")}` ); - if (command.lavalink) { - if (client.lavalinkUsing.length == 0) + if (command.accessableby == Accessableby.Premium) { + const user = client.premiums.get(interaction.user.id); + if (!user || !user.isPremium) { + const embed = new EmbedBuilder() + .setAuthor({ + name: `${client.i18n.get( + language, + "nopremium", + "premium_author" + )}`, + iconURL: client.user!.displayAvatarURL(), + }) + .setDescription( + `${client.i18n.get(language, "nopremium", "premium_desc")}` + ) + .setColor(client.color) + .setTimestamp(); return (interaction as NoAutoInteraction).reply({ - embeds: [ - new EmbedBuilder() - .setDescription( - `${client.i18n.get(language, "music", "no_node")}` - ) - .setColor(client.color), - ], + content: " ", + embeds: [embed], }); + } } - if (command) { - try { - command.run(interaction, client, language); - } catch (error) { - client.logger.log({ - level: "error", - message: error, - }); - return (interaction as NoAutoInteraction).editReply({ - content: `${client.i18n.get( - language, - "interaction", - "error" - )}\n ${error}`, - }); - } + try { + command.run(interaction, client, language); + } catch (error) { + client.logger.log({ + level: "error", + message: error, + }); } } } diff --git a/src/events/guild/messageCreate.ts b/src/events/guild/messageCreate.ts index d34aede3..080160eb 100644 --- a/src/events/guild/messageCreate.ts +++ b/src/events/guild/messageCreate.ts @@ -95,40 +95,75 @@ export default class { client.commands.get(client.aliases.get(cmd) as string); if (!command) return; - if ( - !message.guild!.members.me!.permissions.has( - PermissionsBitField.Flags.SendMessages - ) - ) - return await message.author.dmChannel!.send({ - embeds: [ - new EmbedBuilder() - .setDescription( - `${client.i18n.get(language, "interaction", "no_perms")}` - ) - .setColor(client.color), - ], - }); - if ( - !message.guild!.members.me!.permissions.has( - PermissionsBitField.Flags.ViewChannel - ) - ) - return; - if ( - !message.guild!.members.me!.permissions.has( - PermissionsBitField.Flags.EmbedLinks - ) - ) - return await message.reply({ - embeds: [ - new EmbedBuilder() - .setDescription( - `${client.i18n.get(language, "interaction", "no_perms")}` - ) - .setColor(client.color), - ], - }); + //////////////////////////////// Permission check start //////////////////////////////// + const permissionArrayHelp = [ + PermissionsBitField.Flags.SendMessages, + PermissionsBitField.Flags.ViewChannel, + PermissionsBitField.Flags.EmbedLinks, + ]; + + const permissionArrayNoHelp = [ + PermissionsBitField.Flags.ViewChannel, + PermissionsBitField.Flags.EmbedLinks, + PermissionsBitField.Flags.Speak, + PermissionsBitField.Flags.Connect, + PermissionsBitField.Flags.ManageMessages, + PermissionsBitField.Flags.ManageChannels, + ]; + + function getPermissionName(permission: bigint): string { + for (const perm of Object.keys(PermissionsBitField.Flags)) { + if ((PermissionsBitField.Flags as any)[perm] === permission) { + return perm; + } + } + return "UnknownPermission"; + } + + if (command.name == "help") { + for (const permBit of permissionArrayHelp) { + const embed = new EmbedBuilder() + .setDescription( + `${client.i18n.get(language, "interaction", "no_perms", { + perm: getPermissionName(permBit), + })}` + ) + .setColor(client.color); + + if (!message.guild!.members.me!.permissions.has(permBit)) { + const dmChannel = + message.author.dmChannel == null + ? await message.author.createDM() + : message.author.dmChannel; + return dmChannel.send({ + embeds: [embed], + }); + } + } + } else { + const fullPermArray = []; + fullPermArray.push(...permissionArrayHelp, ...permissionArrayNoHelp); + for (const permBit of fullPermArray) { + const embed = new EmbedBuilder() + .setDescription( + `${client.i18n.get(language, "interaction", "no_perms", { + perm: getPermissionName(permBit), + })}` + ) + .setColor(client.color); + + if (!message.guild!.members.me!.permissions.has(permBit)) { + const dmChannel = + message.author.dmChannel == null + ? await message.author.createDM() + : message.author.dmChannel!; + return dmChannel.send({ + embeds: [embed], + }); + } + } + } + //////////////////////////////// Permission check end //////////////////////////////// if ( command.accessableby == Accessableby.Owner && @@ -203,19 +238,17 @@ export default class { }); } - if (command) { - try { - command.run(client, message, args, language, PREFIX); - } catch (error) { - client.logger.error(error); - message.reply({ - content: `${client.i18n.get( - language, - "interaction", - "error" - )}\n ${error}`, - }); - } + try { + command.run(client, message, args, language, PREFIX); + } catch (error) { + client.logger.error(error); + message.reply({ + content: `${client.i18n.get( + language, + "interaction", + "error" + )}\n ${error}`, + }); } } } diff --git a/src/languages/en/interaction.yaml b/src/languages/en/interaction.yaml index 8e676c36..d3bfa518 100644 --- a/src/languages/en/interaction.yaml +++ b/src/languages/en/interaction.yaml @@ -4,7 +4,7 @@ dev_only: The bot is under maintenance. (Please come back again later) # No permission to use command (this for bot!) -no_perms: I don't have perms to execute command! +no_perms: "I don't have perms to execute command! `%{perm}`" # Bot getting error something! error: Something went wrong. diff --git a/src/languages/vi/interaction.yaml b/src/languages/vi/interaction.yaml index 71fcf79a..882f3348 100644 --- a/src/languages/vi/interaction.yaml +++ b/src/languages/vi/interaction.yaml @@ -4,7 +4,7 @@ dev_only: Bot đang được bảo trì. (Vui lòng quay lại sau) # No permission to use command (this for bot!) -no_perms: Tôi không có quyền để thực hiện lệnh! +no_perms: "Tôi không có quyền để thực hiện lệnh! `%{perm}`" # Bot getting error something! error: Đã xảy ra lỗi. From 017348c52dd92f6118716462e20f550ae9192dad Mon Sep 17 00:00:00 2001 From: RainyXeon / Date: Fri, 29 Dec 2023 18:29:20 +0700 Subject: [PATCH 07/28] Rebuild permission system for interaction and message --- src/@types/Interaction.ts | 2 ++ src/events/guild/interactionCreate.ts | 48 +++++++++++++++++++++++++++ src/events/guild/messageCreate.ts | 48 ++++++++++----------------- 3 files changed, 68 insertions(+), 30 deletions(-) diff --git a/src/@types/Interaction.ts b/src/@types/Interaction.ts index d0925241..a8b66007 100644 --- a/src/@types/Interaction.ts +++ b/src/@types/Interaction.ts @@ -24,6 +24,8 @@ export type NoAutoInteraction = | ButtonInteraction | ModalSubmitInteraction; +export type ReplyOnlyInteraction = CommandInteraction | ButtonInteraction; + export type AutocompleteInteractionChoices = { name: string; value: string; diff --git a/src/events/guild/interactionCreate.ts b/src/events/guild/interactionCreate.ts index ec306c0e..0358bac1 100644 --- a/src/events/guild/interactionCreate.ts +++ b/src/events/guild/interactionCreate.ts @@ -9,6 +9,7 @@ import { Manager } from "../../manager.js"; import { GlobalInteraction, NoAutoInteraction, + ReplyOnlyInteraction, } from "../../@types/Interaction.js"; import { Accessableby } from "../../@types/Command.js"; @@ -106,6 +107,53 @@ export default class { client.logger.info(`${msg_cmd.join(" ")}`); + //////////////////////////////// Permission check start //////////////////////////////// + const defaultPermissions = [PermissionsBitField.Flags.ManageMessages]; + + const musicPermissions = [ + PermissionsBitField.Flags.Speak, + PermissionsBitField.Flags.Connect, + ]; + + const managePermissions = [PermissionsBitField.Flags.ManageChannels]; + + function getPermissionName(permission: bigint): string { + for (const perm of Object.keys(PermissionsBitField.Flags)) { + if ((PermissionsBitField.Flags as any)[perm] === permission) { + return perm; + } + } + return "UnknownPermission"; + } + + function checkPermission(permArray: bigint[]) { + for (const permBit of permArray) { + const embed = new EmbedBuilder() + .setDescription( + `${client.i18n.get(language, "interaction", "no_perms", { + perm: getPermissionName(permBit), + })}` + ) + .setColor(client.color); + + if (!interaction.guild!.members.me!.permissions.has(permBit)) { + return (interaction as ReplyOnlyInteraction).reply({ + embeds: [embed], + }); + break; + } + } + } + + if (command.name[0] !== "help") { + checkPermission(defaultPermissions); + } else if (command.category == "Music") { + checkPermission(musicPermissions); + } else if (command.accessableby == Accessableby.Manager) { + checkPermission(managePermissions); + } + //////////////////////////////// Permission check end //////////////////////////////// + if ( command.accessableby == Accessableby.Manager && !(interaction.member!.permissions as Readonly).has( diff --git a/src/events/guild/messageCreate.ts b/src/events/guild/messageCreate.ts index 080160eb..7563da59 100644 --- a/src/events/guild/messageCreate.ts +++ b/src/events/guild/messageCreate.ts @@ -96,21 +96,21 @@ export default class { if (!command) return; //////////////////////////////// Permission check start //////////////////////////////// - const permissionArrayHelp = [ + const defaultPermissions = [ PermissionsBitField.Flags.SendMessages, PermissionsBitField.Flags.ViewChannel, PermissionsBitField.Flags.EmbedLinks, ]; - const permissionArrayNoHelp = [ - PermissionsBitField.Flags.ViewChannel, - PermissionsBitField.Flags.EmbedLinks, + const allCommandPermissions = [PermissionsBitField.Flags.ManageMessages]; + + const musicPermissions = [ PermissionsBitField.Flags.Speak, PermissionsBitField.Flags.Connect, - PermissionsBitField.Flags.ManageMessages, - PermissionsBitField.Flags.ManageChannels, ]; + const managePermissions = [PermissionsBitField.Flags.ManageChannels]; + function getPermissionName(permission: bigint): string { for (const perm of Object.keys(PermissionsBitField.Flags)) { if ((PermissionsBitField.Flags as any)[perm] === permission) { @@ -120,8 +120,8 @@ export default class { return "UnknownPermission"; } - if (command.name == "help") { - for (const permBit of permissionArrayHelp) { + async function checkPermission(permArray: bigint[]) { + for (const permBit of permArray) { const embed = new EmbedBuilder() .setDescription( `${client.i18n.get(language, "interaction", "no_perms", { @@ -135,33 +135,21 @@ export default class { message.author.dmChannel == null ? await message.author.createDM() : message.author.dmChannel; - return dmChannel.send({ + dmChannel.send({ embeds: [embed], }); + break; } } - } else { - const fullPermArray = []; - fullPermArray.push(...permissionArrayHelp, ...permissionArrayNoHelp); - for (const permBit of fullPermArray) { - const embed = new EmbedBuilder() - .setDescription( - `${client.i18n.get(language, "interaction", "no_perms", { - perm: getPermissionName(permBit), - })}` - ) - .setColor(client.color); + } - if (!message.guild!.members.me!.permissions.has(permBit)) { - const dmChannel = - message.author.dmChannel == null - ? await message.author.createDM() - : message.author.dmChannel!; - return dmChannel.send({ - embeds: [embed], - }); - } - } + await checkPermission(defaultPermissions); + if (command.accessableby == Accessableby.Manager) { + checkPermission(managePermissions); + } else if (command.category == "Music") { + checkPermission(musicPermissions); + } else if (command.name !== "help") { + checkPermission(allCommandPermissions); } //////////////////////////////// Permission check end //////////////////////////////// From aa96f020fd1c0bb5f1f586db090c39b685366837 Mon Sep 17 00:00:00 2001 From: RainyXeon / Date: Fri, 29 Dec 2023 19:23:46 +0700 Subject: [PATCH 08/28] Add CheckPermissionServices --- src/events/guild/interactionCreate.ts | 63 ++++++++++----------- src/events/guild/messageCreate.ts | 70 +++++++++++++----------- src/utilities/CheckPermissionServices.ts | 37 +++++++++++++ 3 files changed, 106 insertions(+), 64 deletions(-) create mode 100644 src/utilities/CheckPermissionServices.ts diff --git a/src/events/guild/interactionCreate.ts b/src/events/guild/interactionCreate.ts index 0358bac1..368904ce 100644 --- a/src/events/guild/interactionCreate.ts +++ b/src/events/guild/interactionCreate.ts @@ -12,6 +12,7 @@ import { ReplyOnlyInteraction, } from "../../@types/Interaction.js"; import { Accessableby } from "../../@types/Command.js"; +import { CheckPermissionServices } from "../../utilities/CheckPermissionServices.js"; /** * @param {GlobalInteraction} interaction @@ -108,6 +109,7 @@ export default class { client.logger.info(`${msg_cmd.join(" ")}`); //////////////////////////////// Permission check start //////////////////////////////// + const permissionChecker = new CheckPermissionServices(); const defaultPermissions = [PermissionsBitField.Flags.ManageMessages]; const musicPermissions = [ @@ -117,40 +119,39 @@ export default class { const managePermissions = [PermissionsBitField.Flags.ManageChannels]; - function getPermissionName(permission: bigint): string { - for (const perm of Object.keys(PermissionsBitField.Flags)) { - if ((PermissionsBitField.Flags as any)[perm] === permission) { - return perm; - } - } - return "UnknownPermission"; - } - - function checkPermission(permArray: bigint[]) { - for (const permBit of permArray) { - const embed = new EmbedBuilder() - .setDescription( - `${client.i18n.get(language, "interaction", "no_perms", { - perm: getPermissionName(permBit), - })}` - ) - .setColor(client.color); - - if (!interaction.guild!.members.me!.permissions.has(permBit)) { - return (interaction as ReplyOnlyInteraction).reply({ - embeds: [embed], - }); - break; - } - } + async function respondError(permission: string) { + const embed = new EmbedBuilder() + .setDescription( + `${client.i18n.get(language, "interaction", "no_perms", { + perm: permission, + })}` + ) + .setColor(client.color); + await (interaction as ReplyOnlyInteraction).reply({ + embeds: [embed], + }); } if (command.name[0] !== "help") { - checkPermission(defaultPermissions); - } else if (command.category == "Music") { - checkPermission(musicPermissions); - } else if (command.accessableby == Accessableby.Manager) { - checkPermission(managePermissions); + const returnData = await permissionChecker.interaction( + interaction, + defaultPermissions + ); + if (returnData !== "PermissionPass") return respondError(returnData); + } + if (command.category.toLocaleLowerCase() == "music") { + const returnData = await permissionChecker.interaction( + interaction, + musicPermissions + ); + if (returnData !== "PermissionPass") return respondError(returnData); + } + if (command.accessableby == Accessableby.Manager) { + const returnData = await permissionChecker.interaction( + interaction, + managePermissions + ); + if (returnData !== "PermissionPass") return respondError(returnData); } //////////////////////////////// Permission check end //////////////////////////////// diff --git a/src/events/guild/messageCreate.ts b/src/events/guild/messageCreate.ts index 7563da59..b3ef2e2a 100644 --- a/src/events/guild/messageCreate.ts +++ b/src/events/guild/messageCreate.ts @@ -4,6 +4,7 @@ import { PermissionsBitField, EmbedBuilder } from "discord.js"; import { stripIndents } from "common-tags"; import fs from "fs"; import { Accessableby } from "../../@types/Command.js"; +import { CheckPermissionServices } from "../../utilities/CheckPermissionServices.js"; export default class { async execute(client: Manager, message: Message) { @@ -96,6 +97,7 @@ export default class { if (!command) return; //////////////////////////////// Permission check start //////////////////////////////// + const permissionChecker = new CheckPermissionServices(); const defaultPermissions = [ PermissionsBitField.Flags.SendMessages, PermissionsBitField.Flags.ViewChannel, @@ -111,45 +113,47 @@ export default class { const managePermissions = [PermissionsBitField.Flags.ManageChannels]; - function getPermissionName(permission: bigint): string { - for (const perm of Object.keys(PermissionsBitField.Flags)) { - if ((PermissionsBitField.Flags as any)[perm] === permission) { - return perm; - } - } - return "UnknownPermission"; + async function respondError(permission: string) { + const embed = new EmbedBuilder() + .setDescription( + `${client.i18n.get(language, "interaction", "no_perms", { + perm: permission, + })}` + ) + .setColor(client.color); + const dmChannel = + message.author.dmChannel == null + ? await message.author.createDM() + : message.author.dmChannel; + dmChannel.send({ + embeds: [embed], + }); } - async function checkPermission(permArray: bigint[]) { - for (const permBit of permArray) { - const embed = new EmbedBuilder() - .setDescription( - `${client.i18n.get(language, "interaction", "no_perms", { - perm: getPermissionName(permBit), - })}` - ) - .setColor(client.color); - - if (!message.guild!.members.me!.permissions.has(permBit)) { - const dmChannel = - message.author.dmChannel == null - ? await message.author.createDM() - : message.author.dmChannel; - dmChannel.send({ - embeds: [embed], - }); - break; - } - } - } + const returnData = await permissionChecker.message( + message, + defaultPermissions + ); + if (returnData !== "PermissionPass") return respondError(returnData); - await checkPermission(defaultPermissions); if (command.accessableby == Accessableby.Manager) { - checkPermission(managePermissions); + const returnData = await permissionChecker.message( + message, + managePermissions + ); + if (returnData !== "PermissionPass") return respondError(returnData); } else if (command.category == "Music") { - checkPermission(musicPermissions); + const returnData = await permissionChecker.message( + message, + musicPermissions + ); + if (returnData !== "PermissionPass") return respondError(returnData); } else if (command.name !== "help") { - checkPermission(allCommandPermissions); + const returnData = await permissionChecker.message( + message, + allCommandPermissions + ); + if (returnData !== "PermissionPass") return respondError(returnData); } //////////////////////////////// Permission check end //////////////////////////////// diff --git a/src/utilities/CheckPermissionServices.ts b/src/utilities/CheckPermissionServices.ts new file mode 100644 index 00000000..2f8cae93 --- /dev/null +++ b/src/utilities/CheckPermissionServices.ts @@ -0,0 +1,37 @@ +import { Message, PermissionsBitField } from "discord.js"; +import { GlobalInteraction } from "../@types/Interaction.js"; + +export class CheckPermissionServices { + interaction( + interaction: GlobalInteraction, + permArray: bigint[] + ): "PermissionPass" | string { + for (const permBit of permArray) { + if (!interaction.guild!.members.me!.permissions.has(permBit)) { + return String(this.getPermissionName(permBit)); + } + } + return "PermissionPass"; + } + + message( + message: Message, + permArray: bigint[] + ): "PermissionPass" | string { + for (const permBit of permArray) { + if (!message.guild!.members.me!.permissions.has(permBit)) { + return String(this.getPermissionName(permBit)); + } + } + return "PermissionPass"; + } + + private getPermissionName(permission: bigint): string { + for (const perm of Object.keys(PermissionsBitField.Flags)) { + if ((PermissionsBitField.Flags as any)[perm] === permission) { + return perm; + } + } + return "UnknownPermission"; + } +} From 1b3385d252afafdcd837c5a5bb49630a69c5cd1e Mon Sep 17 00:00:00 2001 From: RainyXeon / Date: Fri, 29 Dec 2023 20:03:40 +0700 Subject: [PATCH 09/28] Add check for Voice Channel --- src/events/guild/interactionCreate.ts | 9 ++++--- src/events/guild/messageCreate.ts | 18 ++++++------- src/utilities/CheckPermissionServices.ts | 32 ++++++++++++++++++------ 3 files changed, 39 insertions(+), 20 deletions(-) diff --git a/src/events/guild/interactionCreate.ts b/src/events/guild/interactionCreate.ts index 368904ce..41292e18 100644 --- a/src/events/guild/interactionCreate.ts +++ b/src/events/guild/interactionCreate.ts @@ -4,6 +4,7 @@ import { CommandInteraction, EmbedBuilder, CommandInteractionOptionResolver, + PermissionFlagsBits, } from "discord.js"; import { Manager } from "../../manager.js"; import { @@ -110,14 +111,14 @@ export default class { //////////////////////////////// Permission check start //////////////////////////////// const permissionChecker = new CheckPermissionServices(); - const defaultPermissions = [PermissionsBitField.Flags.ManageMessages]; + const defaultPermissions = [PermissionFlagsBits.ManageMessages]; const musicPermissions = [ - PermissionsBitField.Flags.Speak, - PermissionsBitField.Flags.Connect, + PermissionFlagsBits.Speak, + PermissionFlagsBits.Connect, ]; - const managePermissions = [PermissionsBitField.Flags.ManageChannels]; + const managePermissions = [PermissionFlagsBits.ManageChannels]; async function respondError(permission: string) { const embed = new EmbedBuilder() diff --git a/src/events/guild/messageCreate.ts b/src/events/guild/messageCreate.ts index b3ef2e2a..d6941e4f 100644 --- a/src/events/guild/messageCreate.ts +++ b/src/events/guild/messageCreate.ts @@ -1,4 +1,4 @@ -import { ChannelType, Message } from "discord.js"; +import { ChannelType, Message, PermissionFlagsBits } from "discord.js"; import { Manager } from "../../manager.js"; import { PermissionsBitField, EmbedBuilder } from "discord.js"; import { stripIndents } from "common-tags"; @@ -99,19 +99,19 @@ export default class { //////////////////////////////// Permission check start //////////////////////////////// const permissionChecker = new CheckPermissionServices(); const defaultPermissions = [ - PermissionsBitField.Flags.SendMessages, - PermissionsBitField.Flags.ViewChannel, - PermissionsBitField.Flags.EmbedLinks, + PermissionFlagsBits.SendMessages, + PermissionFlagsBits.ViewChannel, + PermissionFlagsBits.EmbedLinks, ]; - const allCommandPermissions = [PermissionsBitField.Flags.ManageMessages]; + const allCommandPermissions = [PermissionFlagsBits.ManageMessages]; const musicPermissions = [ - PermissionsBitField.Flags.Speak, - PermissionsBitField.Flags.Connect, + PermissionFlagsBits.Speak, + PermissionFlagsBits.Connect, ]; - const managePermissions = [PermissionsBitField.Flags.ManageChannels]; + const managePermissions = [PermissionFlagsBits.ManageChannels]; async function respondError(permission: string) { const embed = new EmbedBuilder() @@ -173,7 +173,7 @@ export default class { if ( command.accessableby == Accessableby.Manager && - !message.member!.permissions.has(PermissionsBitField.Flags.ManageGuild) + !message.member!.permissions.has(PermissionFlagsBits.ManageGuild) ) return message.reply({ embeds: [ diff --git a/src/utilities/CheckPermissionServices.ts b/src/utilities/CheckPermissionServices.ts index 2f8cae93..f1fb2908 100644 --- a/src/utilities/CheckPermissionServices.ts +++ b/src/utilities/CheckPermissionServices.ts @@ -1,4 +1,4 @@ -import { Message, PermissionsBitField } from "discord.js"; +import { Message, PermissionFlagsBits } from "discord.js"; import { GlobalInteraction } from "../@types/Interaction.js"; export class CheckPermissionServices { @@ -6,29 +6,47 @@ export class CheckPermissionServices { interaction: GlobalInteraction, permArray: bigint[] ): "PermissionPass" | string { + const isUserInVoice = interaction.guild?.members.cache.get( + interaction.user.id + )?.voice.channel; + for (const permBit of permArray) { if (!interaction.guild!.members.me!.permissions.has(permBit)) { return String(this.getPermissionName(permBit)); } + if ( + isUserInVoice && + !isUserInVoice + .permissionsFor(interaction.guild.members.me!) + .has(permBit) + ) { + return String(this.getPermissionName(permBit)); + } } + return "PermissionPass"; } - message( - message: Message, - permArray: bigint[] - ): "PermissionPass" | string { + message(message: Message, permArray: bigint[]): "PermissionPass" | string { + const isUserInVoice = message.guild?.members.cache.get(message.author.id) + ?.voice.channel; for (const permBit of permArray) { if (!message.guild!.members.me!.permissions.has(permBit)) { return String(this.getPermissionName(permBit)); } + if ( + isUserInVoice && + !isUserInVoice.permissionsFor(message.guild.members.me!).has(permBit) + ) { + return String(this.getPermissionName(permBit)); + } } return "PermissionPass"; } private getPermissionName(permission: bigint): string { - for (const perm of Object.keys(PermissionsBitField.Flags)) { - if ((PermissionsBitField.Flags as any)[perm] === permission) { + for (const perm of Object.keys(PermissionFlagsBits)) { + if ((PermissionFlagsBits as any)[perm] === permission) { return perm; } } From ba091234509b38b23d33d3f6613e76cc6876e62f Mon Sep 17 00:00:00 2001 From: RainyXeon / Date: Fri, 29 Dec 2023 20:11:31 +0700 Subject: [PATCH 10/28] Add check for textBased channels in CheckPermissionServices --- src/utilities/CheckPermissionServices.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/utilities/CheckPermissionServices.ts b/src/utilities/CheckPermissionServices.ts index f1fb2908..ac7a9d7d 100644 --- a/src/utilities/CheckPermissionServices.ts +++ b/src/utilities/CheckPermissionServices.ts @@ -10,6 +10,10 @@ export class CheckPermissionServices { interaction.user.id )?.voice.channel; + const isUserInText = interaction.guild?.channels.cache.get( + String(interaction.channelId) + ); + for (const permBit of permArray) { if (!interaction.guild!.members.me!.permissions.has(permBit)) { return String(this.getPermissionName(permBit)); @@ -22,6 +26,13 @@ export class CheckPermissionServices { ) { return String(this.getPermissionName(permBit)); } + if ( + isUserInText && + !isUserInText + .permissionsFor(interaction.guild!.members.me!) + .has(permBit) + ) + return String(this.getPermissionName(permBit)); } return "PermissionPass"; @@ -30,6 +41,9 @@ export class CheckPermissionServices { message(message: Message, permArray: bigint[]): "PermissionPass" | string { const isUserInVoice = message.guild?.members.cache.get(message.author.id) ?.voice.channel; + const isUserInText = message.guild?.channels.cache.get( + String(message.channelId) + ); for (const permBit of permArray) { if (!message.guild!.members.me!.permissions.has(permBit)) { return String(this.getPermissionName(permBit)); @@ -40,6 +54,11 @@ export class CheckPermissionServices { ) { return String(this.getPermissionName(permBit)); } + if ( + isUserInText && + !isUserInText.permissionsFor(message.guild!.members.me!).has(permBit) + ) + return String(this.getPermissionName(permBit)); } return "PermissionPass"; } From dac066f00ab43d7acf3ed6c3467b295a0131cf39 Mon Sep 17 00:00:00 2001 From: RainyXeon / Date: Fri, 29 Dec 2023 20:31:00 +0700 Subject: [PATCH 11/28] Change to v4.2.0 --- src/manifest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/manifest.xml b/src/manifest.xml index ac5a12a1..e5c2ed85 100644 --- a/src/manifest.xml +++ b/src/manifest.xml @@ -7,7 +7,7 @@ - 4.1.2 + 4.2.0 4.2.0 hatsuharu (AzurLane) From 3a6149dad14802225be3037c96ffb4c710edf272 Mon Sep 17 00:00:00 2001 From: RainyXeon / Date: Sat, 30 Dec 2023 07:44:24 +0700 Subject: [PATCH 12/28] Patch play command in prefix mode --- src/commands/prefix/Music/Play.ts | 9 +++++++++ src/commands/prefix/{Admin => Owner}/Shutdown.ts | 2 +- src/commands/prefix/{Utils => Owner}/Status.ts | 2 +- src/commands/slash/{Admin => Owner}/Shutdown.ts | 2 +- src/commands/slash/{Utils => Owner}/Status.ts | 4 ++-- src/events/guild/voiceStateUpdate.ts | 7 +++++++ 6 files changed, 21 insertions(+), 5 deletions(-) rename src/commands/prefix/{Admin => Owner}/Shutdown.ts (97%) rename src/commands/prefix/{Utils => Owner}/Status.ts (99%) rename src/commands/slash/{Admin => Owner}/Shutdown.ts (97%) rename src/commands/slash/{Utils => Owner}/Status.ts (98%) diff --git a/src/commands/prefix/Music/Play.ts b/src/commands/prefix/Music/Play.ts index ec68b630..6790dbd2 100644 --- a/src/commands/prefix/Music/Play.ts +++ b/src/commands/prefix/Music/Play.ts @@ -23,6 +23,15 @@ export default class implements PrefixCommand { let player = client.manager.players.get(message.guild!.id); const value = args[0]; + if (!value) + return message.reply({ + embeds: [ + new EmbedBuilder() + .setDescription(`${client.i18n.get(language, "music", "play_arg")}`) + .setColor(client.color), + ], + }); + const msg = await message.reply({ embeds: [ new EmbedBuilder() diff --git a/src/commands/prefix/Admin/Shutdown.ts b/src/commands/prefix/Owner/Shutdown.ts similarity index 97% rename from src/commands/prefix/Admin/Shutdown.ts rename to src/commands/prefix/Owner/Shutdown.ts index 65f43d73..b92046da 100644 --- a/src/commands/prefix/Admin/Shutdown.ts +++ b/src/commands/prefix/Owner/Shutdown.ts @@ -5,7 +5,7 @@ import { Manager } from "../../../manager.js"; export default class implements PrefixCommand { name = "shutdown"; description = "Shuts down the client!"; - category = "Admin"; + category = "Owner"; accessableby = Accessableby.Owner; usage = ""; aliases = []; diff --git a/src/commands/prefix/Utils/Status.ts b/src/commands/prefix/Owner/Status.ts similarity index 99% rename from src/commands/prefix/Utils/Status.ts rename to src/commands/prefix/Owner/Status.ts index 62e41450..925ea434 100644 --- a/src/commands/prefix/Utils/Status.ts +++ b/src/commands/prefix/Owner/Status.ts @@ -8,7 +8,7 @@ import { Accessableby, PrefixCommand } from "../../../@types/Command.js"; export default class implements PrefixCommand { name = "status-channel"; description = "Create bot status channel"; - category = "Utils"; + category = "Owner"; accessableby = Accessableby.Owner; aliases = ["sc"]; usage = ""; diff --git a/src/commands/slash/Admin/Shutdown.ts b/src/commands/slash/Owner/Shutdown.ts similarity index 97% rename from src/commands/slash/Admin/Shutdown.ts rename to src/commands/slash/Owner/Shutdown.ts index cef3e668..8fc24338 100644 --- a/src/commands/slash/Admin/Shutdown.ts +++ b/src/commands/slash/Owner/Shutdown.ts @@ -5,7 +5,7 @@ import { Accessableby, SlashCommand } from "../../../@types/Command.js"; export default class implements SlashCommand { name = ["sudo", "shutdown"]; description = "Shuts down the client!"; - category = "Admin"; + category = "Owner"; accessableby = Accessableby.Owner; lavalink = false; options = []; diff --git a/src/commands/slash/Utils/Status.ts b/src/commands/slash/Owner/Status.ts similarity index 98% rename from src/commands/slash/Utils/Status.ts rename to src/commands/slash/Owner/Status.ts index c17fea32..71bcfde5 100644 --- a/src/commands/slash/Utils/Status.ts +++ b/src/commands/slash/Owner/Status.ts @@ -13,9 +13,9 @@ import os from "os"; import { stripIndents } from "common-tags"; export default class implements SlashCommand { - name = ["settings", "status"]; + name = ["sudo", "status-channel"]; description = "Create bot status channel"; - category = "Utils"; + category = "Owner"; accessableby = Accessableby.Owner; lavalink = false; options = [ diff --git a/src/events/guild/voiceStateUpdate.ts b/src/events/guild/voiceStateUpdate.ts index 9665ccf3..927aac2c 100644 --- a/src/events/guild/voiceStateUpdate.ts +++ b/src/events/guild/voiceStateUpdate.ts @@ -70,6 +70,13 @@ export default class { ) { if (oldState.channelId) return; if (oldState.channelId === newState.channelId) return; + if ( + oldState.guild.members.me!.voice.channel && + oldState.guild.members.me!.voice.channel.members.filter( + (m) => !m.user.bot + ).size !== 0 + ) + return; // Resume player player.pause(false); const msg = await leaveEmbed.send({ From f37cb0dd11fe1669b0095251c601b66992b7d24b Mon Sep 17 00:00:00 2001 From: RainyXeon / Date: Sat, 30 Dec 2023 19:23:21 +0700 Subject: [PATCH 13/28] Patch voiceStateUpdate --- src/events/guild/voiceStateUpdate.ts | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/events/guild/voiceStateUpdate.ts b/src/events/guild/voiceStateUpdate.ts index 927aac2c..c2ae6e5e 100644 --- a/src/events/guild/voiceStateUpdate.ts +++ b/src/events/guild/voiceStateUpdate.ts @@ -65,20 +65,14 @@ export default class { if ( newState.guild.members.me!.voice?.channel && newState.guild.members.me!.voice.channel.members.filter( - (m) => !m.user.bot + (m) => m.user.id !== client.user?.id ).size !== 0 ) { if (oldState.channelId) return; if (oldState.channelId === newState.channelId) return; - if ( - oldState.guild.members.me!.voice.channel && - oldState.guild.members.me!.voice.channel.members.filter( - (m) => !m.user.bot - ).size !== 0 - ) - return; + if (newState.guild.members.me!.voice.channel.members.size > 2) return; // Resume player - player.pause(false); + !player.paused ? true : player.pause(false); const msg = await leaveEmbed.send({ embeds: [ new EmbedBuilder() @@ -105,7 +99,7 @@ export default class { ).size === 0 ) { // Pause player - player.pause(true); + player.paused ? true : player.pause(true); const msg = await leaveEmbed.send({ embeds: [ new EmbedBuilder() From 8ae9ba37a32ea6cd8ec9779d90aa75aecbfcebb9 Mon Sep 17 00:00:00 2001 From: RainyXeon / Date: Sat, 30 Dec 2023 19:37:52 +0700 Subject: [PATCH 14/28] Patch voiceStateUpdate --- src/events/guild/voiceStateUpdate.ts | 61 +++++++++++++++------------- 1 file changed, 33 insertions(+), 28 deletions(-) diff --git a/src/events/guild/voiceStateUpdate.ts b/src/events/guild/voiceStateUpdate.ts index c2ae6e5e..0c93ccd4 100644 --- a/src/events/guild/voiceStateUpdate.ts +++ b/src/events/guild/voiceStateUpdate.ts @@ -72,20 +72,22 @@ export default class { if (oldState.channelId === newState.channelId) return; if (newState.guild.members.me!.voice.channel.members.size > 2) return; // Resume player - !player.paused ? true : player.pause(false); - const msg = await leaveEmbed.send({ - embeds: [ - new EmbedBuilder() - .setDescription( - `${client.i18n.get(language, "player", "leave_resume")}` - ) - .setColor(client.color), - ], - }); - setTimeout( - async () => msg.delete(), - client.config.bot.DELETE_MSG_TIMEOUT - ); + player.paused == false ? true : player.pause(false); + if (player.paused == false) { + const msg = await leaveEmbed.send({ + embeds: [ + new EmbedBuilder() + .setDescription( + `${client.i18n.get(language, "player", "leave_resume")}` + ) + .setColor(client.color), + ], + }); + setTimeout( + async () => msg.delete(), + client.config.bot.DELETE_MSG_TIMEOUT + ); + } } if ( @@ -99,20 +101,23 @@ export default class { ).size === 0 ) { // Pause player - player.paused ? true : player.pause(true); - const msg = await leaveEmbed.send({ - embeds: [ - new EmbedBuilder() - .setDescription( - `${client.i18n.get(language, "player", "leave_pause")}` - ) - .setColor(client.color), - ], - }); - setTimeout( - async () => msg.delete(), - client.config.bot.DELETE_MSG_TIMEOUT - ); + player.paused == true ? true : player.pause(true); + + if (player.paused == true) { + const msg = await leaveEmbed.send({ + embeds: [ + new EmbedBuilder() + .setDescription( + `${client.i18n.get(language, "player", "leave_pause")}` + ) + .setColor(client.color), + ], + }); + setTimeout( + async () => msg.delete(), + client.config.bot.DELETE_MSG_TIMEOUT + ); + } // Delay leave timeout await delay(client.config.lavalink.LEAVE_TIMEOUT); From efbf9407f56e1c641ee4fd3023d4cbb9bef13691 Mon Sep 17 00:00:00 2001 From: RainyXeon / Date: Sat, 30 Dec 2023 21:09:07 +0700 Subject: [PATCH 15/28] Patch voiceStateUpdate --- src/events/guild/voiceStateUpdate.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/events/guild/voiceStateUpdate.ts b/src/events/guild/voiceStateUpdate.ts index 0c93ccd4..5938981b 100644 --- a/src/events/guild/voiceStateUpdate.ts +++ b/src/events/guild/voiceStateUpdate.ts @@ -73,7 +73,7 @@ export default class { if (newState.guild.members.me!.voice.channel.members.size > 2) return; // Resume player player.paused == false ? true : player.pause(false); - if (player.paused == false) { + if (player.paused == false && player.shoukaku.track !== null) { const msg = await leaveEmbed.send({ embeds: [ new EmbedBuilder() @@ -103,7 +103,7 @@ export default class { // Pause player player.paused == true ? true : player.pause(true); - if (player.paused == true) { + if (player.paused == true && player.shoukaku.track !== null) { const msg = await leaveEmbed.send({ embeds: [ new EmbedBuilder() From 7a595f75852707e8f56c569f99020f3ef0699e3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zoldy=E2=9A=A1?= <58603220+ZoldZap@users.noreply.github.com> Date: Sat, 30 Dec 2023 21:07:45 +0600 Subject: [PATCH 16/28] Update music.yaml --- src/languages/en/music.yaml | 247 +++++++++++++----------------------- 1 file changed, 86 insertions(+), 161 deletions(-) diff --git a/src/languages/en/music.yaml b/src/languages/en/music.yaml index 1420862e..c9b4a509 100644 --- a/src/languages/en/music.yaml +++ b/src/languages/en/music.yaml @@ -1,206 +1,131 @@ -### 247 command! -247_loading: "Loading please wait..." -247_invalid: "Invalid 247 mode" -247_off: "`🌙` | *Mode 24/7 has been:* `Deactivated`" -247_on: "`🌕` | *Mode 24/7 has been:* `Activated`" -247_on_already: "`🌕` | *24/7 is already in mode:* `Activated`" -247_off_already: "`🌙` | *24/7 is already in mode:* `Deactivated`" +### 24/7 command! +247_loading: "`⏳` | Loading **24/7** mode..." +247_on: "`✅` | 24/7 mode is now **Enabled**!" +247_off: "`❌` | 24/7 mode is now **Disabled**!" +247_on_already: "`⚠️` | 24/7 mode is already **Enabled**!" +247_off_already: "`⚠️` | 24/7 mode is already **Disabled**!" +247_invalid: "`⚠️` | Invalid 24/7 mode! Please use **enable** or **disable**!" ### Autoplay command! -autoplay_loading: "Loading please wait..." -autoplay_off: "`📻` | **Autoplay has been:** `Deactivated`" -autoplay_on: "`📻` | **Autoplay has been:** `Activated`" +autoplay_loading: "`⏳` | Loading **Autoplay**..." +autoplay_on: "`✅` | Autoplay is now **Enabled**!" +autoplay_off: "`❌` | Autoplay is now **Disabled**!" -### Clearqueue command! -clearqueue_loading: "Loading please wait..." -clearqueue_msg: "`📛` | **Queue has been:** `Cleared`" +### ClearQueue command! +clearqueue_loading: "`⏳` | **Clearing Queue**..." +clearqueue_msg: "`🗑️` | Queue has been **Cleared**!" ### Forward command! -forward_loading: "Loading please wait..." -forward_msg: "`⏭` | **Forward to:** `%{duration}`" -forward_beyond: "Cannot forward beyond the song's duration." -forward_invalid: "Invalid argument, must be a number.\nCorrect Usage: `%{prefix}forward `" +forward_loading: "`⏳` | **Forwarding**..." +forward_msg: "`⏩` | Forwarded to `%{duration}`!" +forward_beyond: "`⚠️` | Song is about to end. You can't forward beyond it!" +forward_invalid: "`⚠️` | Something went wrong! Please try again." ### Join command! -join_loading: "Loading please wait..." -join_voice: "You need to be in a voice channel to use the join command." -join_msg: "`🔊` | **Joined to:** `%{channel}`" +join_loading: "`⏳` | **Joining**..." +join_msg: "`🔊` | Joined **%{channel}**" +join_voice: "`⚠️` | You need to be in a voice channel to use this command!" -### Leave command! -stop_loading: "Loading please wait..." -stop_msg: "`👋` | **Bot has been:** `Disconnected`" +### Stop command! +stop_loading: "`⏳` | **Stopping**..." +stop_msg: "`⏹️` | Stopped the **Player**!" ### Loop command! -loop_loading: "Loading please wait..." -loop_invalid: "⚠️ | You must specify a valid loop mode. Valid modes: %{mode}!" -loop_current: "`🔁` | **Loop Mode:** `Current`" -unloop_current: "`🔁` | **Song is unloop:** `Current`" -loop_all: "`🔁` | **Loop Mode:** `Queue`" -unloop_all: "`🔁` | **Loop Mode:** `None`" +loop_loading: "`⏳` | **Loading**..." +loop_current: "`🔁` | Looping current **Song**!" +loop_all: "`🔁` | Looping **Queue**!" +unloop_all: "`❌` | Loop is now **Disabled**!" +loop_invalid: "`⚠️` | Invalid loop mode! Please use %{mode}!" ### Loopall command! -loopall_loading: "Loading please wait..." -loopall: "`🔁` | **Song is loop:** `All`" -unloopall: "`🔁` | **Loop Mode:** `None`" +loopall_loading: "`⏳` | **Loading**..." +loopall: "`🔁` | Looping **Queue**!" +unloopall: "`❌` | Loop is now **Disabled**!" ### Lyrics command! -lyrics_loading: "Searching for lyrics..." -lyrics_notfound: "Couldn't find any lyrics for that song!" -lyrics_title: "Lyrics for %{song}" -lyrics_toolong: "Lyrics too long to display!" +lyrics_loading: "`🔍` | Searching for **Lyrics**..." +lyrics_title: "📜 %{song}" +lyrics_notfound: "`⚠️` | No lyrics found!" +lyrics_toolong: "`⚠️` | Lyrics are too long to be displayed!" ### Nowplaying command! -np_loading: "Loading please wait..." - -np_title: "Now playing..." -np_title_pause: "Song pause..." +np_loading: "`⏳` | **Loading**..." np_icon: "https://cdn.discordapp.com/emojis/741605543046807626.gif" - -# Embed Field -np_author: "Author:" -np_request: "Requester:" -np_volume: "Volume:" -np_view: "Views:" -np_upload: "Upload At:" -np_download: "Download:" -np_current_duration: "Current Duration: `[%{current_duration} / %{total_duration}]`" - -# Need in voice to use button -np_invoice: "You need to be in a same/voice channel." - -# Message Button -np_switch_pause: "Paused" -np_switch_resume: "Resumed" -np_pause_msg: "`⏯` | **Song has been:** `%{pause}`" - -np_replay_msg: "`⏮` | **Song has been:** `Replayed`" - -np_stop_msg: "`🚫` | **Song has been:** `Stopped`" - -np_skip_msg: "`⏭` | **Song has been:** `Skipped`" - -np_switch_enable: "Enabled" -np_switch_disable: "Disabled" -np_repeat_msg: "`🔁` | *Loop has been:* `%{loop}`" +np_title: "Now playing..." +np_title_pause: "Paused" +np_current_duration: "`⌛` | Current Duration: `[%{current_duration} / %{total_duration}]`" ### Pause command! -pause_loading: "Loading please wait..." -pause_switch_pause: "Paused" -pause_switch_resume: "Resumed" -pause_msg: "`⏯` | **Song has been:** `%{pause}`" +pause_loading: "`⏳` | **Pausing**..." +pause_msg: "`⏸️` | Paused the **Player**!" ### Play command! -play_loading: "🔍 **Searching...** `%{result}`" -play_invoice: "You need to be in a voice channel to use command." -play_join: "I don't have permission to join your voice channel." -play_speak: "I don't have permission to speak in your voice channel." -play_arg: "Please provide a song name or link to search." -play_startwith: "Please use link to play music." -play_invalid_file: "Please use a valid music file to use this feature. Note that only mp3/ogg extension is supported, professional music file extensions like flac/wav will not be supported." -play_warning_file: "Warning: The system cannot detect your file type. The system may not be able to play music. We recommend that you choose any file type with .mp3 extension. " - -play_track: "**Queued • [%{title}](%{url})** `%{duration}` • %{request}" -play_playlist: "**Queued • [%{title}](%{url})** `%{duration}` (%{songs} tracks) • %{request}" -play_result: "**Queued • [%{title}](%{url})** `%{duration}` • %{request}" - -play_fail: "Error loading track failed" -play_match: "Error song not matches" +play_loading: "`🔍` | Searching **%{result}**" +play_track: "`💾` | Queued **[%{title}](%{url})** `%{duration}` • %{request}" +play_playlist: "`💾` | Queued **[%{title}](%{url})** `%{duration}` • (**%{songs} songs**) • %{request}" +play_result: "`💾` | Queued **[%{title}](%{url})** `%{duration}` • %{request}" +play_arg: "`⚠️` | Please provide a song name or URL!" +play_match: "`⚠️` | No song found!" +play_speak: "`⚠️` | I don't have permission to speak in this channel!" +play_startwith: "`⚠️` | Please use URL to play a song!" +play_invalid_file: "`⚠️` | Invalid file type! Please use **mp3** or **ogg**!" +play_warning_file: "`⚠️` | I could not detect the file type! Please use **mp3** or **ogg**!" ### Previous command! -previous_loading: "Loading please wait..." -previous_notfound: "No previous song/s found." -previous_msg: "`⏮` | *Song has been:* `Previous`" +previous_loading: "`⏳` | **Loading**..." +previous_msg: "`⏮️` | Skipped to previous song!" +previous_notfound: "`⚠️` | No previous song found!" ### Queue command! -queue_author: "Queue - %{guild}" -queue_description: "*Currently Playing*\n*[%{title}](%{url})* `[%{duration}]` • %{request}\n\n*Rest of queue*:%{rest}" -queue_footer: "Page • %{page}/%{pages} | %{queue_lang} • Song | %{duration} • Total duration" -queue_notnumber: "Page must be a number." -queue_page_notfound: "There are only %{page} pages available." +queue_author: "💾 %{guild}" +queue_description: "`📀` | Currently Playing:\n**[%{title}](%{url})** `[%{duration}]` • %{request}\n\n`💤` | Rest of Queue:**%{rest}**" +queue_footer: "Page • %{page}/%{pages} | Song • %{queue_lang} | Total Duration • %{duration}" +queue_notnumber: "`⚠️` | Please provide a valid number!" +queue_page_notfound: "`⚠️` | There are only **%{page}** pages!" ### Replay command! -replay_loading: "Loading please wait..." -replay_msg: "`⏮` | **Song has been:** `Replayed`" +replay_loading: "`⏳` | **Replaying**..." +replay_msg: "`🔄` | Replayed the **Song**!" ### Resume command! -resume_loading: "Loading please wait..." -resume_switch_pause: "Paused" -resume_switch_resume: "Resumed" -resume_msg: "`⏯` | **Song has been:** `%{resume}`" +resume_loading: "`⏳` | **Resuming**..." +resume_msg: "`▶️` | Resumed the **Player**!" ### Rewind command! -rewind_loading: "Loading please wait..." -rewind_msg: "`⏮` | **Rewind to:** `%{duration}`" -rewind_beyond: "Cannot rewind beyond the song's duration." -rewind_invalid: "Invalid argument, must be a number.\nCorrect Usage: `%{prefix}rewind `" +rewind_loading: "`⏳` | **Rewinding**..." +rewind_msg: "`⏪` | Rewinded to `%{duration}`!" +rewind_beyond: "`⚠️` | Song just started. You can't rewind beyond it!" +rewind_invalid: "`⚠️` | Something went wrong! Please try again." ### RemoveTrack command! -removetrack_loading: "Loading please wait..." - -removetrack_already: "Cannot remove a song that is already playing." -removetrack_notfound: "Song not found." - -removetrack_desc: "**Removed • [%{name}](%{url})** `%{duration}` • %{request}" - -### RemoveTrack command! -removetrack_duplicate_desc: "Removed `%{removed}` tracks from queue \n Before: `%{original}` | After: `%{new}`" - -### Search command! -search_loading: "Loading please wait..." -search_invoice: "You need to be in a voice channel to use command." -search_join: "I don't have permission to join your voice channel." -search_speak: "I don't have permission to speak in your voice channel." -search_arg: "Please provide a song name or link to search." - -search_title: "Song Selection..." -search_select: "**(%{num}.) [%{title}](%{url})** `%{duration}` Author: `%{author}`" -search_footer: "Please select a song in 30 seconds." -search_no_response: "No response." - -search_result: "**Queued • [%{title}](%{url})** `%{duration}` • %{request}" -search_playlist: "**Queued • [%{title}](%{url})** `%{duration}` (%{songs} tracks) • %{request}" - -search_fail: "Error loading track failed" -search_match: "Error song not matches" +removetrack_loading: "`⏳` | **Removing**..." +removetrack_desc: "`🗑️` | Removed **[%{name}](%{url})** `%{duration}` • %{request}" +removetrack_duplicate_desc: "`🗑️` | Removed **%{removed}** duplicate songs from the queue!" +removetrack_already: "`⚠️` | I can't remove a song that's already playing!" +removetrack_notfound: "`⚠️` | No song found!" ### Seek command! -seek_loading: "Loading please wait..." -seek_invalid: "Invalid format. Please provide a timestamp.\nExample: `%{prefix}seek 0:59 or 120:00`" -seek_beyond: "Cannot seek beyond length of song." -seek_msg: "`⏭` | **Seeked to:** `%{duration}`" +seek_loading: "`⏳` | **Seeking**..." +seek_msg: "`➿` | Seeked to `%{duration}`!" +seek_beyond: "`⚠️` | You can't seek beyond the song duration!" +seek_invalid: "`⚠️` | Invalid seek duration! Please use a valid timestamp. Example: **1:30**!" ### Shuffle command! -shuffle_loading: "Loading please wait..." -shuffle_msg: "`🔀` | **Queue has been:** `Shuffled`" +shuffle_loading: "`⏳` | **Shuffling**..." +shuffle_msg: "`🔀` | Shuffled the **Queue**!" ### Skip command! -skip_loading: "Loading please wait..." -skip_msg: "`⏭` | **Song has been:** `Skipped`" - -### Skipto command! -skipto_loading: "Loading please wait..." -skipto_invalid_position: "Invalid number" -skipto_arg: "Cannot skip to a song that is already playing. To skip the current playing song type: `%{prefix}skip`" -skipto_invalid: "The song number is invalid." -skipto_msg: "`⏭` | *Song has been:* `Skipto %{position}`" +skip_loading: "`⏳` | **Skipping**..." +skip_msg: "`⏭️` | Skipped the **Song**!" ### Volume command! -volume_loading: "Loading please wait..." -volume_usage: "*Current volume:* `%{volume}%`" -volume_invalid: "You may only set the volume to 1% - 100%" -volume_msg: "`🔊` | **Change volume to:** `%{volume}%`" - -### Radio command! -radio_invalid: "Invalid number. Please choose a number from 1-34 \nFor radio list, please type /music radio" -radio_invoice: "You need to be in a voice channel to use command." -radio_join: "I don't have permission to join your voice channel." -radio_speak: "I don't have permission to speak in your voice channel." -radio_loading: "Loading please wait..." -radio_track: "**Queued • [%{title}](%{url})** `%{duration}` • %{request}" -radio_match: "This radio has been down, link error or broken. Please report this error to XeonDex #0017 to fix!" +volume_loading: "`⏳` | Changing **Volume**..." +volume_usage: "`🔊` | Current volume is **%{volume}%**" +volume_msg: "`🔊` | Volume has been set to **%{volume}%**" +volume_invalid: "`⚠️` | Invalid volume! Please use a number between **1** and **100**!" ### Utils -number_invalid: "Invalid argument, must be a number." enabled: "Enabled" disabled: "Disabled" -no_node: "No lavalink server avalible! \nPlease try again after 5 minutes." +number_invalid: "`⚠️` | Please provide a valid number!" +no_node: "`⚠️` | No lavalink server found! Please try again after **5 Minutes**." From c0c8aec9aebf335045f4018c2208c29bcf4dcd2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zoldy=E2=9A=A1?= <58603220+ZoldZap@users.noreply.github.com> Date: Sat, 30 Dec 2023 21:12:24 +0600 Subject: [PATCH 17/28] Delete src/languages/en/radio.yaml --- src/languages/en/radio.yaml | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 src/languages/en/radio.yaml diff --git a/src/languages/en/radio.yaml b/src/languages/en/radio.yaml deleted file mode 100644 index c7d1bbdc..00000000 --- a/src/languages/en/radio.yaml +++ /dev/null @@ -1,2 +0,0 @@ -available_radio: "**Available Radio Stations**" -standard_radio: "***:radio: Standard Radio***" From 1df8c13a094f8182870b8179b24f324ecb7d286c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zoldy=E2=9A=A1?= <58603220+ZoldZap@users.noreply.github.com> Date: Sat, 30 Dec 2023 21:13:17 +0600 Subject: [PATCH 18/28] Delete src/languages/vi/radio.yaml --- src/languages/vi/radio.yaml | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 src/languages/vi/radio.yaml diff --git a/src/languages/vi/radio.yaml b/src/languages/vi/radio.yaml deleted file mode 100644 index 268d36f8..00000000 --- a/src/languages/vi/radio.yaml +++ /dev/null @@ -1,2 +0,0 @@ -available_radio: "**Các đài phát thanh có sẵn**" -standard_radio: "***:radio: Các đài phát thanh tiêu chuẩn***" From 4e0a782a869e6ebe36b45a9a39ff52a734271e5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zoldy=E2=9A=A1?= <58603220+ZoldZap@users.noreply.github.com> Date: Sat, 30 Dec 2023 21:21:17 +0600 Subject: [PATCH 19/28] Update Loop.ts --- src/commands/prefix/Music/Loop.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/prefix/Music/Loop.ts b/src/commands/prefix/Music/Loop.ts index 11ee309c..8f7a0d96 100644 --- a/src/commands/prefix/Music/Loop.ts +++ b/src/commands/prefix/Music/Loop.ts @@ -57,7 +57,7 @@ export default class implements PrefixCommand { ], }); - const mode_array = ["none", "song", "queue"]; + const mode_array = ["song", "queue", "none"]; const mode = args[0]; From 48bb9c5ead35fb35c97a383667c3981ddf5be4c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zoldy=E2=9A=A1?= <58603220+ZoldZap@users.noreply.github.com> Date: Sat, 30 Dec 2023 21:24:37 +0600 Subject: [PATCH 20/28] Update File.ts --- src/commands/prefix/Music/File.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/prefix/Music/File.ts b/src/commands/prefix/Music/File.ts index 8c001a32..2728200d 100644 --- a/src/commands/prefix/Music/File.ts +++ b/src/commands/prefix/Music/File.ts @@ -39,7 +39,7 @@ export default class implements PrefixCommand { embeds: [ new EmbedBuilder() .setDescription( - `${client.i18n.get(language, "music", "play_loading", { + `${client.i18n.get(language, "music", "loop_loading", { result: file.name, })}` ) From 14d174c7b4bb80a8df6398c6fcb12da8367f1e82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zoldy=E2=9A=A1?= <58603220+ZoldZap@users.noreply.github.com> Date: Sat, 30 Dec 2023 21:25:08 +0600 Subject: [PATCH 21/28] Update File.ts --- src/commands/slash/Music/File.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/slash/Music/File.ts b/src/commands/slash/Music/File.ts index cd5a04cd..f35f20b0 100644 --- a/src/commands/slash/Music/File.ts +++ b/src/commands/slash/Music/File.ts @@ -41,7 +41,7 @@ export default class implements SlashCommand { embeds: [ new EmbedBuilder() .setDescription( - `${client.i18n.get(language, "music", "247_loading")}` + `${client.i18n.get(language, "music", "loop_loading")}` ) .setColor(client.color), ], From 9419b4d775c7e809c80c16754575b8858beaad08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zoldy=E2=9A=A1?= <58603220+ZoldZap@users.noreply.github.com> Date: Sat, 30 Dec 2023 21:36:59 +0600 Subject: [PATCH 22/28] Update music.yaml --- src/languages/en/music.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/languages/en/music.yaml b/src/languages/en/music.yaml index c9b4a509..35bbf691 100644 --- a/src/languages/en/music.yaml +++ b/src/languages/en/music.yaml @@ -66,8 +66,11 @@ play_playlist: "`💾` | Queued **[%{title}](%{url})** `%{duration}` • (**%{so play_result: "`💾` | Queued **[%{title}](%{url})** `%{duration}` • %{request}" play_arg: "`⚠️` | Please provide a song name or URL!" play_match: "`⚠️` | No song found!" -play_speak: "`⚠️` | I don't have permission to speak in this channel!" play_startwith: "`⚠️` | Please use URL to play a song!" + +### File command! +file_loading: "`⏳` | **Loading**..." +play_speak: "`⚠️` | I don't have permission to speak in this channel!" play_invalid_file: "`⚠️` | Invalid file type! Please use **mp3** or **ogg**!" play_warning_file: "`⚠️` | I could not detect the file type! Please use **mp3** or **ogg**!" @@ -100,10 +103,12 @@ rewind_invalid: "`⚠️` | Something went wrong! Please try again." ### RemoveTrack command! removetrack_loading: "`⏳` | **Removing**..." removetrack_desc: "`🗑️` | Removed **[%{name}](%{url})** `%{duration}` • %{request}" -removetrack_duplicate_desc: "`🗑️` | Removed **%{removed}** duplicate songs from the queue!" removetrack_already: "`⚠️` | I can't remove a song that's already playing!" removetrack_notfound: "`⚠️` | No song found!" +### RemoveDuplicate command! +removetrack_duplicate_desc: "`🗑️` | Removed **%{removed}** duplicate songs from the queue!" + ### Seek command! seek_loading: "`⏳` | **Seeking**..." seek_msg: "`➿` | Seeked to `%{duration}`!" From 9a282cf5f0c0b7c6f5b2be5bf453880ee776ad22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zoldy=E2=9A=A1?= <58603220+ZoldZap@users.noreply.github.com> Date: Sat, 30 Dec 2023 21:41:50 +0600 Subject: [PATCH 23/28] Update File.ts --- src/commands/slash/Music/File.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/slash/Music/File.ts b/src/commands/slash/Music/File.ts index f35f20b0..81e90e6d 100644 --- a/src/commands/slash/Music/File.ts +++ b/src/commands/slash/Music/File.ts @@ -41,7 +41,7 @@ export default class implements SlashCommand { embeds: [ new EmbedBuilder() .setDescription( - `${client.i18n.get(language, "music", "loop_loading")}` + `${client.i18n.get(language, "music", "file_loading")}` ) .setColor(client.color), ], From e7322699ad8fe3dc450822e6b9461fcd86cda8a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zoldy=E2=9A=A1?= <58603220+ZoldZap@users.noreply.github.com> Date: Sat, 30 Dec 2023 21:42:12 +0600 Subject: [PATCH 24/28] Update File.ts --- src/commands/prefix/Music/File.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/prefix/Music/File.ts b/src/commands/prefix/Music/File.ts index 2728200d..00052567 100644 --- a/src/commands/prefix/Music/File.ts +++ b/src/commands/prefix/Music/File.ts @@ -39,7 +39,7 @@ export default class implements PrefixCommand { embeds: [ new EmbedBuilder() .setDescription( - `${client.i18n.get(language, "music", "loop_loading", { + `${client.i18n.get(language, "music", "file_loading", { result: file.name, })}` ) From 956820abe5c0d65b60980ed807080d8f78978cca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zoldy=E2=9A=A1?= <58603220+ZoldZap@users.noreply.github.com> Date: Sun, 31 Dec 2023 00:39:56 +0600 Subject: [PATCH 25/28] Update music.yaml --- src/languages/en/music.yaml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/languages/en/music.yaml b/src/languages/en/music.yaml index 35bbf691..6f5cf3dc 100644 --- a/src/languages/en/music.yaml +++ b/src/languages/en/music.yaml @@ -4,7 +4,7 @@ 247_off: "`❌` | 24/7 mode is now **Disabled**!" 247_on_already: "`⚠️` | 24/7 mode is already **Enabled**!" 247_off_already: "`⚠️` | 24/7 mode is already **Disabled**!" -247_invalid: "`⚠️` | Invalid 24/7 mode! Please use **enable** or **disable**!" +247_invalid: "`⚠️` | Invalid 24/7 mode. Please use **enable** or **disable**!" ### Autoplay command! autoplay_loading: "`⏳` | Loading **Autoplay**..." @@ -19,7 +19,7 @@ clearqueue_msg: "`🗑️` | Queue has been **Cleared**!" forward_loading: "`⏳` | **Forwarding**..." forward_msg: "`⏩` | Forwarded to `%{duration}`!" forward_beyond: "`⚠️` | Song is about to end. You can't forward beyond it!" -forward_invalid: "`⚠️` | Something went wrong! Please try again." +forward_invalid: "`⚠️` | Something went wrong. Please try again!" ### Join command! join_loading: "`⏳` | **Joining**..." @@ -35,7 +35,7 @@ loop_loading: "`⏳` | **Loading**..." loop_current: "`🔁` | Looping current **Song**!" loop_all: "`🔁` | Looping **Queue**!" unloop_all: "`❌` | Loop is now **Disabled**!" -loop_invalid: "`⚠️` | Invalid loop mode! Please use %{mode}!" +loop_invalid: "`⚠️` | Invalid loop mode. Please use %{mode}!" ### Loopall command! loopall_loading: "`⏳` | **Loading**..." @@ -71,8 +71,8 @@ play_startwith: "`⚠️` | Please use URL to play a song!" ### File command! file_loading: "`⏳` | **Loading**..." play_speak: "`⚠️` | I don't have permission to speak in this channel!" -play_invalid_file: "`⚠️` | Invalid file type! Please use **mp3** or **ogg**!" -play_warning_file: "`⚠️` | I could not detect the file type! Please use **mp3** or **ogg**!" +play_invalid_file: "`⚠️` | Invalid file type. Please use **mp3** or **ogg**!" +play_warning_file: "`⚠️` | I could not detect the file type. Please use **mp3** or **ogg**!" ### Previous command! previous_loading: "`⏳` | **Loading**..." @@ -98,7 +98,7 @@ resume_msg: "`▶️` | Resumed the **Player**!" rewind_loading: "`⏳` | **Rewinding**..." rewind_msg: "`⏪` | Rewinded to `%{duration}`!" rewind_beyond: "`⚠️` | Song just started. You can't rewind beyond it!" -rewind_invalid: "`⚠️` | Something went wrong! Please try again." +rewind_invalid: "`⚠️` | Something went wrong. Please try again!" ### RemoveTrack command! removetrack_loading: "`⏳` | **Removing**..." @@ -113,7 +113,7 @@ removetrack_duplicate_desc: "`🗑️` | Removed **%{removed}** duplicate songs seek_loading: "`⏳` | **Seeking**..." seek_msg: "`➿` | Seeked to `%{duration}`!" seek_beyond: "`⚠️` | You can't seek beyond the song duration!" -seek_invalid: "`⚠️` | Invalid seek duration! Please use a valid timestamp. Example: **1:30**!" +seek_invalid: "`⚠️` | Invalid seek duration. Please use a valid timestamp. Example: **1:30**!" ### Shuffle command! shuffle_loading: "`⏳` | **Shuffling**..." @@ -127,10 +127,10 @@ skip_msg: "`⏭️` | Skipped the **Song**!" volume_loading: "`⏳` | Changing **Volume**..." volume_usage: "`🔊` | Current volume is **%{volume}%**" volume_msg: "`🔊` | Volume has been set to **%{volume}%**" -volume_invalid: "`⚠️` | Invalid volume! Please use a number between **1** and **100**!" +volume_invalid: "`⚠️` | Invalid volume. Please use a number between **1** and **100**!" ### Utils enabled: "Enabled" disabled: "Disabled" number_invalid: "`⚠️` | Please provide a valid number!" -no_node: "`⚠️` | No lavalink server found! Please try again after **5 Minutes**." +no_node: "`⚠️` | No lavalink server found. Please try again after **5 Minutes**!" From 641a605e5a76b5daf0ce2062c4e29fadeb4c2e66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zoldy=E2=9A=A1?= <58603220+ZoldZap@users.noreply.github.com> Date: Sun, 31 Dec 2023 00:40:32 +0600 Subject: [PATCH 26/28] Update utilities.yaml --- src/languages/en/utilities.yaml | 49 ++++++++++++++------------------- 1 file changed, 20 insertions(+), 29 deletions(-) diff --git a/src/languages/en/utilities.yaml b/src/languages/en/utilities.yaml index 03a863e2..48414f56 100644 --- a/src/languages/en/utilities.yaml +++ b/src/languages/en/utilities.yaml @@ -1,35 +1,26 @@ -##### Language command ##### -lang_perm: "You need the `MANAGE_GUILD` permission to use this command." -lang_arg: "Please specify a language!" -provide_lang: "**Please provide languages:** \n`%{languages}`" -lang_set: "`🔧` | **Language has been set to:** `%{language}`" -lang_change: "`🔧` | **Language has been change to:** `%{language}`" -lang_error: "Something went wrong please try again later." +### Language command! +lang_set: "`📙` | Language has been set to **%{language}**!" +lang_change: "`📙` | Language has been changed to **%{language}**!" +lang_perm: "`⚠️` | You don't have permission to use this command!" +provide_lang: "`⚠️` | Invalid language. Please use %{languages}!" -##### Restart command ##### -restart_msg: "`🤖` | *Client has been:* `Shutting down`" +### Shutdown command! +restart_msg: "`🛑` | **Shutting down**..." -##### PLayer control command ##### -control_perm: "You need the `MANAGE_GUILD` permission to use this command." -control_set: "`🔧` | *Player control mode has been set to:* `%{toggle}`" -control_change: "`🔧` | *Player control mode has been change to:* `%{toggle}`" -control_err: "An error occured while setting the player control mode!" +### Control command! +control_set: "`🎚️` | Control has been set to **%{toggle}**!" +control_perm: "`⚠️` | You don't have permission to use this command!" -##### Help command ##### -help_desc: "Please Select Category Menu!" -help_category_desc: "Select the %{category} to see all commands." -help_category: "%{category}" -help_timeout: "```Help Menu timed out try using %{prefix}help again.```" +### Help command! +help_desc: "Click Me!" +help_timeout: "`⏳` | Help Menu timed out. Please use **%{prefix}help** again!" -##### Prefix command ##### -prefix_perm: "You need the `MANAGE_GUILD` permission to use this command." -prefix_arg: "Please specify a prefix!" -prefix_length: "The prefix can't be longer than 10 characters!" -prefix_set: "`🔧` | *Prefix has been set to:* `%{prefix}`" -prefix_change: "`🔧` | *Prefix has been change to:* `%{prefix}`" -prefix_error: "An error occured while setting the prefix!" +### Prefix command! +prefix_set: "`㊙️` | Prefix has been set to **%{prefix}**" +prefix_change: "`㊙️` | Prefix has been changed to **%{prefix}**" +prefix_perm: "`⚠️` | You don't have permission to use this command!" +prefix_arg: "`⚠️` | Please provide a prefix!" +prefix_length: "`⚠️` | Prefix can't be longer than **10 Characters**!" -arg_error: "Please specify a `%{text}`!" -page_title: "Online: 🟢 / Offline: 🔴" -page_footer: "Page • %{page}/%{pages}" +arg_error: "`⚠️` | Invalid argument. Please use **%{text}**" From f1c21817f85f4050703ae70ae3078c12680153a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zoldy=E2=9A=A1?= <58603220+ZoldZap@users.noreply.github.com> Date: Sun, 31 Dec 2023 01:06:19 +0600 Subject: [PATCH 27/28] Update interaction.yaml --- src/languages/en/interaction.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/languages/en/interaction.yaml b/src/languages/en/interaction.yaml index d3bfa518..65aba9f6 100644 --- a/src/languages/en/interaction.yaml +++ b/src/languages/en/interaction.yaml @@ -1,13 +1,13 @@ -##### InteractionCreate Event ##### +### InteractionCreate Event! # On settings/config.js in DEV_ID -dev_only: The bot is under maintenance. (Please come back again later) +dev_only: "`⚠️` | I am under maintenance. Please try again later!" # No permission to use command (this for bot!) -no_perms: "I don't have perms to execute command! `%{perm}`" +no_perms: "`⚠️` | I don't have **%{perm}** permission to execute this command!" # Bot getting error something! -error: Something went wrong. +error: "`⚠️` | Something went wrong. Please try again later!" # You are not the client owner of this bot! -owner_only: You're not the client owner! +owner_only: "`⚠️` | You're not my owner!" From 26046faa64a82c25c2ef6dec40bd4b46b7325d57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zoldy=E2=9A=A1?= <58603220+ZoldZap@users.noreply.github.com> Date: Sun, 31 Dec 2023 01:25:00 +0600 Subject: [PATCH 28/28] Update info.yaml --- src/languages/en/info.yaml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/languages/en/info.yaml b/src/languages/en/info.yaml index 380de3b4..b26be226 100644 --- a/src/languages/en/info.yaml +++ b/src/languages/en/info.yaml @@ -1,9 +1,13 @@ +### Developer command! dev_title: "RainyXeon" dev_desc: "A versatile and powerful music bot for Discord that brings rhythm and melody to your server. " dev_foot: "Consider Joining the server or Inviting the Bot :) This would help me alot!" -inv_title: "**Thanks for Inviting %{username}**" -inv_desc: "**%{username} Powered by RainyXeon**" +### Invite command! +inv_title: "🙌 Thanks for Inviting %{username}" +inv_desc: "**%{username}** Powered by **RainyXeon**" -ping_title: "**Ping of **" -ping_desc: "My Ping is ***%{ping}ms***" + +### Ping command! +ping_title: "🏓 " +ping_desc: "My Ping is **%{ping}ms**!"