Merge pull request #372 from mariusbegby/reorganize-command-files-into-one-folder

Reorganize command files into one folder
This commit is contained in:
Marius Begby authored and GitHub committed 2024-01-30 11:11:05 +01:00
commit 5bd6a09f83
28 files changed
+167 -177

No files matched your search

+9 -9
View File
@@ -46,7 +46,7 @@
"guilds": { "guilds": {
"metadata": { "metadata": {
"name": "gremios", "name": "gremios",
"description": "Muestra el top 25 de gremios por número de miembros." "description": "Mostrar el top 25 de gremios por número de miembros."
}, },
"topGuildsByMemberCount": "{{icon}} **Principales {{count}} servidores por cantidad de miembros ({{totalCount}} en total)**", "topGuildsByMemberCount": "{{icon}} **Principales {{count}} servidores por cantidad de miembros ({{totalCount}} en total)**",
"totalMembers": "**Total de miembros:** **`{{count}`**" "totalMembers": "**Total de miembros:** **`{{count}`**"
@@ -62,7 +62,7 @@
}, },
"history": { "history": {
"metadata": { "metadata": {
"name": "historia", "name": "historial",
"description": "Mostrar historial de canciones que se han reproducido.", "description": "Mostrar historial de canciones que se han reproducido.",
"options": { "options": {
"page": { "page": {
@@ -153,7 +153,7 @@
"nowplaying": { "nowplaying": {
"metadata": { "metadata": {
"name": "reproduciendo", "name": "reproduciendo",
"description": "Muestra información sobre la canción actual." "description": "Mostrar información sobre la canción actual."
}, },
"embedFields": { "embedFields": {
"author": "**Artista**", "author": "**Artista**",
@@ -196,7 +196,7 @@
"queue": { "queue": {
"metadata": { "metadata": {
"name": "cola", "name": "cola",
"description": "Muestra las canciones que se han añadido a la cola.", "description": "Mostrar las canciones que se han añadido a la cola.",
"options": { "options": {
"page": { "page": {
"name": "página", "name": "página",
@@ -293,7 +293,7 @@
"shards": { "shards": {
"metadata": { "metadata": {
"name": "shards", "name": "shards",
"description": "Muestra información sobre todos los shards conectados.", "description": "Mostrar información sobre todos los fragmentos conectados.",
"options": { "options": {
"sort": { "sort": {
"name": "ordenar", "name": "ordenar",
@@ -341,7 +341,7 @@
"status": { "status": {
"metadata": { "metadata": {
"name": "estado", "name": "estado",
"description": "Muestra el estado operativo del bot." "description": "Mostrar el estado operativo del bot."
}, },
"openSourceButtonLabel": "GitHub" "openSourceButtonLabel": "GitHub"
}, },
@@ -354,14 +354,14 @@
}, },
"systemstatus": { "systemstatus": {
"metadata": { "metadata": {
"name": "Información del sistema", "name": "estado-sistema",
"description": "Muestra el estado operativo del bot con información técnica adicional." "description": "Mostrar el estado operativo del bot con información técnica adicional."
} }
}, },
"volume": { "volume": {
"metadata": { "metadata": {
"name": "volumen", "name": "volumen",
"description": "Muestra o cambia el volumen de reproducción.", "description": "Mostrar o cambia el volumen de reproducción.",
"options": { "options": {
"percentage": { "percentage": {
"name": "porcentaje", "name": "porcentaje",
+19 -19
View File
@@ -16,8 +16,8 @@
}, },
"trackHistoryEmpty": "{{icon}} **Ups!**\nIstoricul e gol, dar poți adăuga niște piese folosind {{playCommand}}!", "trackHistoryEmpty": "{{icon}} **Ups!**\nIstoricul e gol, dar poți adăuga niște piese folosind {{playCommand}}!",
"trackPositionHigherThanHistoryLength_one": "{{icon}} **Ups!**\nMai este doar **o** piesă în istoric. Nu te poți întoarce la poziția **{{backPosition}}**.\n\nPiesele adăugate în istoric pot fi văzute folosind {{historyCommand}}.", "trackPositionHigherThanHistoryLength_one": "{{icon}} **Ups!**\nMai este doar **o** piesă în istoric. Nu te poți întoarce la poziția **{{backPosition}}**.\n\nPiesele adăugate în istoric pot fi văzute folosind {{historyCommand}}.",
"trackPositionHigherThanHistoryLength": "", "trackPositionHigherThanHistoryLength": "{{icon}} **Oops!**\nSunt doar **{{count}}** piese în istorie. Nu te poți întoarce la melodia **{{backPosition}}**.\n\nVezi piesele adăugate în istorie cu {{historyCommand}}.",
"trackReplayed": "" "trackReplayed": "{{icon}} **Rejoacă piesa**\n{{track}}"
}, },
"filters": { "filters": {
"metadata": { "metadata": {
@@ -73,7 +73,7 @@
}, },
"emptyHistory": "Istoricul e gol, adaugă niște piese cu {{playCommand}}!", "emptyHistory": "Istoricul e gol, adaugă niște piese cu {{playCommand}}!",
"invalidPageNumber_one": "{{icon}} **Ups!**\nPagina **`{{page}}`** nu este o pagină validă.\n\nIstoricul conține numai **o** pagină.", "invalidPageNumber_one": "{{icon}} **Ups!**\nPagina **`{{page}}`** nu este o pagină validă.\n\nIstoricul conține numai **o** pagină.",
"invalidPageNumber": "", "invalidPageNumber": "{{icon}} **Hopa!**\nPagina **`{{page}}`** nu este un număr valid de pagină.\n\nExistă doar un total de **`{{count}}`** pagini în istorie.",
"tracksInHistoryTitle": "{{icon}} **Piese în istoric**" "tracksInHistoryTitle": "{{icon}} **Piese în istoric**"
}, },
"join": { "join": {
@@ -148,7 +148,7 @@
}, },
"trackMoved": "{{icon}} **Piesă mutată**\n{track}\n\nPiesa a fost mutată din poziția **`{{fromPosition}}`** la poziția **`{{toPosition}}`**.", "trackMoved": "{{icon}} **Piesă mutată**\n{track}\n\nPiesa a fost mutată din poziția **`{{fromPosition}}`** la poziția **`{{toPosition}}`**.",
"trackPositionHigherThanQueueLength_one": "{{icon}} **Ups!**\nNu poți muta piesa din poziția **`{{fromPosition}}`** spre poziția **`{{toPosition}}`**. Coada conține doar **o** singură piesă.\n\nVezi piese adăugate în coadă folosind {{queueCommand}}.", "trackPositionHigherThanQueueLength_one": "{{icon}} **Ups!**\nNu poți muta piesa din poziția **`{{fromPosition}}`** spre poziția **`{{toPosition}}`**. Coada conține doar **o** singură piesă.\n\nVezi piese adăugate în coadă folosind {{queueCommand}}.",
"trackPositionHigherThanQueueLength": "" "trackPositionHigherThanQueueLength": "{{icon}} **Ups!**\nNu puteți muta melodia în poziția **`{{fromPosition}}`** la poziția **`{{toPosition}}`**. Sunt doar **`{{count}}`** piese în coadă.\n\nVezi melodiile adăugate la coada de redare cu {{queueCommand}}."
}, },
"nowplaying": { "nowplaying": {
"metadata": { "metadata": {
@@ -161,7 +161,7 @@
"source": "**Sursa piesei**" "source": "**Sursa piesei**"
}, },
"otherTracksInQueue_one": "O altă piesă în coadă...", "otherTracksInQueue_one": "O altă piesă în coadă...",
"otherTracksInQueue": "", "otherTracksInQueue": "{{count}} alte piese în coada de aşteptare...",
"playCount_zero": "Necunoscut", "playCount_zero": "Necunoscut",
"playCount": "{{count, number}}" "playCount": "{{count, number}}"
}, },
@@ -188,7 +188,7 @@
"addedToQueueTitle": "{{icon}} **Adăugat în coadă**", "addedToQueueTitle": "{{icon}} **Adăugat în coadă**",
"playlistAddedTitle": "{{icon}} **Playlist adăugat în coadă**", "playlistAddedTitle": "{{icon}} **Playlist adăugat în coadă**",
"playlistAddedTrackCount_one": "Și **o** altă piesă... Folosește {{queueCommand}} pentru a le afișa pe toate.", "playlistAddedTrackCount_one": "Și **o** altă piesă... Folosește {{queueCommand}} pentru a le afișa pe toate.",
"playlistAddedTrackCount": "", "playlistAddedTrackCount": "Și **{{count}}** mai multe piese... Folosește {{queueCommand}} pentru a vedea pe toate.",
"playlistTooLarge": "{{icon}} **Playlist prea mare**\nAcest playlist este prea mare, și nu poate fi adăugat în coadă.\n\nNumărul maxim de piese care pot fi adăugate în coadă este **{{count}}**.", "playlistTooLarge": "{{icon}} **Playlist prea mare**\nAcest playlist este prea mare, și nu poate fi adăugat în coadă.\n\nNumărul maxim de piese care pot fi adăugate în coadă este **{{count}}**.",
"trackNotFound": "{{icon}} **Nicio piesă găsită**\nNu a fost găsit niciun rezultat pentru **{{query}}**.\n\nDacă ai specificat un URL, asigură-te că este corect și public.", "trackNotFound": "{{icon}} **Nicio piesă găsită**\nNu a fost găsit niciun rezultat pentru **{{query}}**.\n\nDacă ai specificat un URL, asigură-te că este corect și public.",
"footerAddedPosition": "Adăugată în coadă în poziția {{position}}" "footerAddedPosition": "Adăugată în coadă în poziția {{position}}"
@@ -209,7 +209,7 @@
"estimatedDuration": "Durată estimată: {{duration}}", "estimatedDuration": "Durată estimată: {{duration}}",
"estimatedReallyLongTime": "Durată estimată: Foarte mult timp", "estimatedReallyLongTime": "Durată estimată: Foarte mult timp",
"invalidPageNumber_one": "{{icon}} **Ups!**\nPagina **`{{page}}`** nu este o pagină validă.\n\nCoada conține numai **o** pagină.", "invalidPageNumber_one": "{{icon}} **Ups!**\nPagina **`{{page}}`** nu este o pagină validă.\n\nCoada conține numai **o** pagină.",
"invalidPageNumber": "" "invalidPageNumber": "{{icon}} **Hopa!**\nPagina **`{{page}}`** nu este un număr valid de pagină.\n\nExistă doar un total de **`{{count}}`** pagini în coadă."
}, },
"reload": { "reload": {
"metadata": { "metadata": {
@@ -270,14 +270,14 @@
}, },
"noTracksRemoved": "{{icon}} **Nicio piesă eliminată**\nNicio piesă nu a fost eliminată din coadă. Verifică dacă filtrul selectat are piese de eliminat.", "noTracksRemoved": "{{icon}} **Nicio piesă eliminată**\nNicio piesă nu a fost eliminată din coadă. Verifică dacă filtrul selectat are piese de eliminat.",
"removedTrack": "{{icon}} **Piesă eliminată**", "removedTrack": "{{icon}} **Piesă eliminată**",
"removedTracks": "", "removedTracks": "{{icon}} **Piese eliminate**\n**`{{count}}`** piese au fost eliminate din coadă.",
"startPositionHigherThanEndPosition": "{{icon}} **Ups!**\nPoziția de început **`{{start}}`** e mai mare decât poziția de sfârșit **`{{end}}`**. Te rog să specifici un interval valid.\n\nView tracks added to the queue with {{queueCommand}}.", "startPositionHigherThanEndPosition": "{{icon}} **Ups!**\nPoziția de început **`{{start}}`** e mai mare decât poziția de sfârșit **`{{end}}`**. Te rog să specifici un interval valid.\n\nView tracks added to the queue with {{queueCommand}}.",
"trackPositionHigherThanQueueLength_one": "{{icon}} **Ups!**\nPoziția **`{{position}}`** nu este o poziția validă în coada de piese. Coada conține numai **o** piesă.\n\nVezi piesele adăugate în coadă folosind {{queueCommand}}.", "trackPositionHigherThanQueueLength_one": "{{icon}} **Ups!**\nPoziția **`{{position}}`** nu este o poziția validă în coada de piese. Coada conține numai **o** piesă.\n\nVezi piesele adăugate în coadă folosind {{queueCommand}}.",
"trackPositionHigherThanQueueLength": "" "trackPositionHigherThanQueueLength": "{{icon}} **Oops!**\nPoziția **`{{position}}`** nu este o poziție validă a piesei. Există doar un total de **`{{count}}`** piese în coada de așteptare.\n\nVezi piesele adăugate la coada de redare cu {{queueCommand}}."
}, },
"seek": { "seek": {
"metadata": { "metadata": {
"name": "", "name": "cauta",
"description": "Navighează la o anumită durată în piesa în curs de redare.", "description": "Navighează la o anumită durată în piesa în curs de redare.",
"options": { "options": {
"duration": { "duration": {
@@ -292,7 +292,7 @@
}, },
"shards": { "shards": {
"metadata": { "metadata": {
"name": "", "name": "cioburi",
"description": "Afișează informații despre toate shardurile conectate.", "description": "Afișează informații despre toate shardurile conectate.",
"options": { "options": {
"sort": { "sort": {
@@ -336,7 +336,7 @@
"emptyQueue": "{{icon}} **Ups!**\nCoada este goală, adaugă niște piese folosind {{playCommand}}!", "emptyQueue": "{{icon}} **Ups!**\nCoada este goală, adaugă niște piese folosind {{playCommand}}!",
"skippedTrack": "{{icon}} **Înaintat**", "skippedTrack": "{{icon}} **Înaintat**",
"trackPositionHigherThanQueueLength_one": "{{icon}} **Ups!**\nCoada conține numai **o** piesă. Nu poți înainta la piesa **{{position}}**.\n\nVezi piesele adăugate în coadă folosind {{queueCommand}}.", "trackPositionHigherThanQueueLength_one": "{{icon}} **Ups!**\nCoada conține numai **o** piesă. Nu poți înainta la piesa **{{position}}**.\n\nVezi piesele adăugate în coadă folosind {{queueCommand}}.",
"trackPositionHigherThanQueueLength": "" "trackPositionHigherThanQueueLength": "{{icon}} **Hopa!**\nSunt doar **{{count}}** piese în coadă. Nu poți sări pentru a urmări **{{position}}**.\n\nVezi melodiile adăugate la coadă cu {{queueCommand}}."
}, },
"status": { "status": {
"metadata": { "metadata": {
@@ -390,7 +390,7 @@
"skip": "Înainte" "skip": "Înainte"
}, },
"footerPageNumber_one": "Pagina {{page}} din {{pageCount}} (o piesă)", "footerPageNumber_one": "Pagina {{page}} din {{pageCount}} (o piesă)",
"footerPageNumber": "", "footerPageNumber": "{{page}} de {{pageCount}} ({{count}} piese)",
"loopingInfo": "{{icon}} **Repetiție**\nModul de repetiție este setat la **`{{loopMode}}`**. Se poate schimba folosind {{loopCommand}}.\n", "loopingInfo": "{{icon}} **Repetiție**\nModul de repetiție este setat la **`{{loopMode}}`**. Se poate schimba folosind {{loopCommand}}.\n",
"nowPausedTitle": "{{icon}} **În pauză**", "nowPausedTitle": "{{icon}} **În pauză**",
"nowPlayingTitle": "{{icon}} **În redare**", "nowPlayingTitle": "{{icon}} **În redare**",
@@ -457,12 +457,12 @@
"trackNotPlayingAnymore": "{{icon}} **Ups!**\nS-a trecut peste această piesă, sau nu mai este în curs de redare." "trackNotPlayingAnymore": "{{icon}} **Ups!**\nS-a trecut peste această piesă, sau nu mai este în curs de redare."
}, },
"errors": { "errors": {
"unexpectedError": "", "unexpectedError": "**{{icon}} Uh-oh... _Ceva nu a mers bine!**\nA apărut o eroare neașteptată în timp ce se încerca efectuarea acestei acțiuni. Poți încerca din nou.\n\n_Dacă problema persistă, te rugăm să trimiți un raport de eroare în **[serverul de suport]({{serverInviteUrl}})**._",
"footerExecutionId": "", "footerExecutionId": "ID execuție: {{executionId}}",
"cannotExtractAudioStream": "", "cannotExtractAudioStream": "**{{icon}} Oops!**\nImposibil de recuperat sunetul pentru piesa **[{{trackTitle}}]({{trackUrl}})**.\n\nSe pare că sursa nu este disponibilă public sau că sursa nu este acceptată.",
"cannotLoadAudioStream": "", "cannotLoadAudioStream": "**{{icon}} Uh-oh... _Ceva nu a mers bine!**\nSe pare că a apărut o problemă în timp ce încărcarea stream-ului pentru piesă.\n\nDacă ai efectuat o comandă, poți încerca din nou.\n\n_Dacă problema persistă, vă rugăm să trimiteți un raport de eroare în **[serverul de suport]({{serverInviteUrl}})**._",
"cannotPlayAudioStream": "", "cannotPlayAudioStream": "**{{icon}} Uh-oh... _Ceva nu a funcționat bine!**\nSe pare că a apărut o problemă în timp ce redai piesa.\n\nDacă ai efectuat o comandă, poți încerca din nou.\n\n_Dacă problema persistă, vă rugăm să trimiteți un raport de eroare în **[serverul de suport]({{serverInviteUrl}})**._",
"generalPlayerError": "" "generalPlayerError": "**{{icon}} Uh-oh... _Ceva nu a mers bine!**\nSe pare că a existat o problemă legată de coada de așteptare sau de piesa curentă.\n\nDacă ai efectuat o comandă, poți încerca din nou.\n\n_Dacă problema persistă, vă rugăm să trimiteți un raport de eroare în **[serverul de suport]({{serverInviteUrl}})**._"
}, },
"systemMessages": { "systemMessages": {
"playerSkipError": "{{icon}} **player.events.on('playerSkip')**\nPiesă URL: {{trackUrl}}\n\n<@{{userId}}>", "playerSkipError": "{{icon}} **player.events.on('playerSkip')**\nPiesă URL: {{trackUrl}}\n\n<@{{userId}}>",
@@ -1,13 +1,13 @@
import { GuildQueue, GuildQueueHistory, Track, useHistory, useQueue } from 'discord-player'; import { GuildQueue, GuildQueueHistory, Track, useHistory, useQueue } from 'discord-player';
import { ChatInputCommandInteraction, EmbedBuilder, SlashCommandBuilder } from 'discord.js'; import { ChatInputCommandInteraction, EmbedBuilder, SlashCommandBuilder } from 'discord.js';
import { BaseSlashCommandInteraction } from '../../../classes/interactions'; import { BaseSlashCommandInteraction } from '../../classes/interactions';
import { BaseSlashCommandParams, BaseSlashCommandReturnType } from '../../../types/interactionTypes'; import { BaseSlashCommandParams, BaseSlashCommandReturnType } from '../../types/interactionTypes';
import { checkHistoryExists, checkQueueCurrentTrack } from '../../../utils/validation/queueValidator'; import { checkHistoryExists, checkQueueCurrentTrack } from '../../utils/validation/queueValidator';
import { checkInVoiceChannel, checkSameVoiceChannel } from '../../../utils/validation/voiceChannelValidator'; import { checkInVoiceChannel, checkSameVoiceChannel } from '../../utils/validation/voiceChannelValidator';
import { Logger } from 'pino'; import { Logger } from 'pino';
import { localizeCommand, useServerTranslator } from '../../../common/localeUtil'; import { localizeCommand, useServerTranslator } from '../../common/localeUtil';
import { TFunction } from 'i18next'; import { TFunction } from 'i18next';
import { formatSlashCommand } from '../../../common/formattingUtils'; import { formatSlashCommand } from '../../common/formattingUtils';
class BackCommand extends BaseSlashCommandInteraction { class BackCommand extends BaseSlashCommandInteraction {
constructor() { constructor() {
@@ -16,17 +16,17 @@ import {
StringSelectMenuOptionBuilder StringSelectMenuOptionBuilder
} from 'discord.js'; } from 'discord.js';
import { Logger } from 'pino'; import { Logger } from 'pino';
import { BaseSlashCommandInteraction } from '../../../classes/interactions'; import { BaseSlashCommandInteraction } from '../../classes/interactions';
import { import {
BiquadFilterOptions, BiquadFilterOptions,
EqualizerFilterOptions, EqualizerFilterOptions,
FFmpegFilterOptions, FFmpegFilterOptions,
FilterOption FilterOption
} from '../../../types/configTypes'; } from '../../types/configTypes';
import { BaseSlashCommandParams, BaseSlashCommandReturnType } from '../../../types/interactionTypes'; import { BaseSlashCommandParams, BaseSlashCommandReturnType } from '../../types/interactionTypes';
import { checkQueueCurrentTrack, checkQueueExists } from '../../../utils/validation/queueValidator'; import { checkQueueCurrentTrack, checkQueueExists } from '../../utils/validation/queueValidator';
import { checkInVoiceChannel, checkSameVoiceChannel } from '../../../utils/validation/voiceChannelValidator'; import { checkInVoiceChannel, checkSameVoiceChannel } from '../../utils/validation/voiceChannelValidator';
import { localizeCommand, useServerTranslator } from '../../../common/localeUtil'; import { localizeCommand, useServerTranslator } from '../../common/localeUtil';
import { TFunction } from 'i18next'; import { TFunction } from 'i18next';
const ffmpegFilterOptions: FFmpegFilterOptions = config.get('ffmpegFilterOptions'); const ffmpegFilterOptions: FFmpegFilterOptions = config.get('ffmpegFilterOptions');
@@ -13,10 +13,10 @@ import {
SlashCommandNumberOption, SlashCommandNumberOption,
SlashCommandStringOption SlashCommandStringOption
} from 'discord.js'; } from 'discord.js';
import { BaseSlashCommandInteraction } from '../../../classes/interactions'; import { BaseSlashCommandInteraction } from '../../classes/interactions';
import { BaseSlashCommandParams, BaseSlashCommandReturnType } from '../../../types/interactionTypes'; import { BaseSlashCommandParams, BaseSlashCommandReturnType } from '../../types/interactionTypes';
import { CommandMetadata, localizeCommand, translatorInstance, useServerTranslator } from '../../../common/localeUtil'; import { CommandMetadata, localizeCommand, translatorInstance, useServerTranslator } from '../../common/localeUtil';
import { ExtendedClient } from '../../../types/clientTypes'; import { ExtendedClient } from '../../types/clientTypes';
class HelpCommand extends BaseSlashCommandInteraction { class HelpCommand extends BaseSlashCommandInteraction {
constructor() { constructor() {
@@ -12,13 +12,13 @@ import {
SlashCommandBuilder SlashCommandBuilder
} from 'discord.js'; } from 'discord.js';
import { Logger } from 'pino'; import { Logger } from 'pino';
import { BaseSlashCommandInteraction } from '../../../classes/interactions'; import { BaseSlashCommandInteraction } from '../../classes/interactions';
import { BaseSlashCommandParams, BaseSlashCommandReturnType } from '../../../types/interactionTypes'; import { BaseSlashCommandParams, BaseSlashCommandReturnType } from '../../types/interactionTypes';
import { checkHistoryExists } from '../../../utils/validation/queueValidator'; import { checkHistoryExists } from '../../utils/validation/queueValidator';
import { checkInVoiceChannel, checkSameVoiceChannel } from '../../../utils/validation/voiceChannelValidator'; import { checkInVoiceChannel, checkSameVoiceChannel } from '../../utils/validation/voiceChannelValidator';
import { localizeCommand, useServerTranslator } from '../../../common/localeUtil'; import { localizeCommand, useServerTranslator } from '../../common/localeUtil';
import { TFunction } from 'i18next'; import { TFunction } from 'i18next';
import { formatRepeatModeDetailed, formatSlashCommand } from '../../../common/formattingUtils'; import { formatRepeatModeDetailed, formatSlashCommand } from '../../common/formattingUtils';
class HistoryCommand extends BaseSlashCommandInteraction { class HistoryCommand extends BaseSlashCommandInteraction {
constructor() { constructor() {
@@ -1,12 +1,12 @@
import { GuildQueue, useMainPlayer, useQueue } from 'discord-player'; import { GuildQueue, useMainPlayer, useQueue } from 'discord-player';
import { ChatInputCommandInteraction, EmbedBuilder, GuildMember, Message, SlashCommandBuilder } from 'discord.js'; import { ChatInputCommandInteraction, EmbedBuilder, GuildMember, Message, SlashCommandBuilder } from 'discord.js';
import { BaseSlashCommandInteraction } from '../../../classes/interactions'; import { BaseSlashCommandInteraction } from '../../classes/interactions';
import { BaseSlashCommandParams, BaseSlashCommandReturnType } from '../../../types/interactionTypes'; import { BaseSlashCommandParams, BaseSlashCommandReturnType } from '../../types/interactionTypes';
import { checkInVoiceChannel } from '../../../utils/validation/voiceChannelValidator'; import { checkInVoiceChannel } from '../../utils/validation/voiceChannelValidator';
import { checkVoicePermissionJoinAndTalk } from '../../../utils/validation/permissionValidator'; import { checkVoicePermissionJoinAndTalk } from '../../utils/validation/permissionValidator';
import { Logger } from 'pino'; import { Logger } from 'pino';
import { localizeCommand, useServerTranslator } from '../../../common/localeUtil'; import { localizeCommand, useServerTranslator } from '../../common/localeUtil';
import { formatSlashCommand } from '../../../common/formattingUtils'; import { formatSlashCommand } from '../../common/formattingUtils';
import { TFunction } from 'i18next'; import { TFunction } from 'i18next';
class JoinCommand extends BaseSlashCommandInteraction { class JoinCommand extends BaseSlashCommandInteraction {
@@ -1,11 +1,11 @@
import { GuildQueue, useQueue } from 'discord-player'; import { GuildQueue, useQueue } from 'discord-player';
import { EmbedBuilder, SlashCommandBuilder } from 'discord.js'; import { EmbedBuilder, SlashCommandBuilder } from 'discord.js';
import { BaseSlashCommandInteraction } from '../../../classes/interactions'; import { BaseSlashCommandInteraction } from '../../classes/interactions';
import { BaseSlashCommandParams, BaseSlashCommandReturnType } from '../../../types/interactionTypes'; import { BaseSlashCommandParams, BaseSlashCommandReturnType } from '../../types/interactionTypes';
import { checkQueueExists } from '../../../utils/validation/queueValidator'; import { checkQueueExists } from '../../utils/validation/queueValidator';
import { checkInVoiceChannel, checkSameVoiceChannel } from '../../../utils/validation/voiceChannelValidator'; import { checkInVoiceChannel, checkSameVoiceChannel } from '../../utils/validation/voiceChannelValidator';
import { localizeCommand, useServerTranslator } from '../../../common/localeUtil'; import { localizeCommand, useServerTranslator } from '../../common/localeUtil';
import { formatSlashCommand } from '../../../common/formattingUtils'; import { formatSlashCommand } from '../../common/formattingUtils';
class LeaveCommand extends BaseSlashCommandInteraction { class LeaveCommand extends BaseSlashCommandInteraction {
constructor() { constructor() {
@@ -7,13 +7,13 @@ import {
SlashCommandIntegerOption SlashCommandIntegerOption
} from 'discord.js'; } from 'discord.js';
import { Logger } from 'pino'; import { Logger } from 'pino';
import { BaseSlashCommandInteraction } from '../../../classes/interactions'; import { BaseSlashCommandInteraction } from '../../classes/interactions';
import { BaseSlashCommandParams, BaseSlashCommandReturnType } from '../../../types/interactionTypes'; import { BaseSlashCommandParams, BaseSlashCommandReturnType } from '../../types/interactionTypes';
import { checkQueueExists } from '../../../utils/validation/queueValidator'; import { checkQueueExists } from '../../utils/validation/queueValidator';
import { checkInVoiceChannel, checkSameVoiceChannel } from '../../../utils/validation/voiceChannelValidator'; import { checkInVoiceChannel, checkSameVoiceChannel } from '../../utils/validation/voiceChannelValidator';
import { localizeCommand, useServerTranslator } from '../../../common/localeUtil'; import { localizeCommand, useServerTranslator } from '../../common/localeUtil';
import { TFunction } from 'i18next'; import { TFunction } from 'i18next';
import { formatRepeatMode } from '../../../common/formattingUtils'; import { formatRepeatMode } from '../../common/formattingUtils';
class LoopCommand extends BaseSlashCommandInteraction { class LoopCommand extends BaseSlashCommandInteraction {
constructor() { constructor() {
@@ -2,11 +2,11 @@ import { LyricsData, lyricsExtractor } from '@discord-player/extractor';
import { GuildQueue, Player, QueryType, SearchResult, Track, useMainPlayer, useQueue } from 'discord-player'; import { GuildQueue, Player, QueryType, SearchResult, Track, useMainPlayer, useQueue } from 'discord-player';
import { ChatInputCommandInteraction, EmbedBuilder, Message, SlashCommandBuilder } from 'discord.js'; import { ChatInputCommandInteraction, EmbedBuilder, Message, SlashCommandBuilder } from 'discord.js';
import { Logger } from 'pino'; import { Logger } from 'pino';
import { BaseSlashCommandInteraction } from '../../../classes/interactions'; import { BaseSlashCommandInteraction } from '../../classes/interactions';
import { BaseSlashCommandParams, BaseSlashCommandReturnType } from '../../../types/interactionTypes'; import { BaseSlashCommandParams, BaseSlashCommandReturnType } from '../../types/interactionTypes';
import { checkQueueCurrentTrack, checkQueueExists } from '../../../utils/validation/queueValidator'; import { checkQueueCurrentTrack, checkQueueExists } from '../../utils/validation/queueValidator';
import { checkInVoiceChannel, checkSameVoiceChannel } from '../../../utils/validation/voiceChannelValidator'; import { checkInVoiceChannel, checkSameVoiceChannel } from '../../utils/validation/voiceChannelValidator';
import { localizeCommand, useServerTranslator } from '../../../common/localeUtil'; import { localizeCommand, useServerTranslator } from '../../common/localeUtil';
import { TFunction } from 'i18next'; import { TFunction } from 'i18next';
class LyricsCommand extends BaseSlashCommandInteraction { class LyricsCommand extends BaseSlashCommandInteraction {
@@ -1,13 +1,13 @@
import { GuildQueue, Track, useQueue } from 'discord-player'; import { GuildQueue, Track, useQueue } from 'discord-player';
import { ChatInputCommandInteraction, EmbedBuilder, SlashCommandBuilder } from 'discord.js'; import { ChatInputCommandInteraction, EmbedBuilder, SlashCommandBuilder } from 'discord.js';
import { BaseSlashCommandInteraction } from '../../../classes/interactions'; import { BaseSlashCommandInteraction } from '../../classes/interactions';
import { BaseSlashCommandParams, BaseSlashCommandReturnType } from '../../../types/interactionTypes'; import { BaseSlashCommandParams, BaseSlashCommandReturnType } from '../../types/interactionTypes';
import { checkQueueCurrentTrack, checkQueueExists } from '../../../utils/validation/queueValidator'; import { checkQueueCurrentTrack, checkQueueExists } from '../../utils/validation/queueValidator';
import { checkInVoiceChannel, checkSameVoiceChannel } from '../../../utils/validation/voiceChannelValidator'; import { checkInVoiceChannel, checkSameVoiceChannel } from '../../utils/validation/voiceChannelValidator';
import { Logger } from 'pino'; import { Logger } from 'pino';
import { localizeCommand, useServerTranslator } from '../../../common/localeUtil'; import { localizeCommand, useServerTranslator } from '../../common/localeUtil';
import { TFunction } from 'i18next'; import { TFunction } from 'i18next';
import { formatSlashCommand } from '../../../common/formattingUtils'; import { formatSlashCommand } from '../../common/formattingUtils';
class MoveCommand extends BaseSlashCommandInteraction { class MoveCommand extends BaseSlashCommandInteraction {
constructor() { constructor() {
@@ -10,13 +10,13 @@ import {
EmbedField, EmbedField,
SlashCommandBuilder SlashCommandBuilder
} from 'discord.js'; } from 'discord.js';
import { BaseSlashCommandInteraction } from '../../../classes/interactions'; import { BaseSlashCommandInteraction } from '../../classes/interactions';
import { BaseSlashCommandParams, BaseSlashCommandReturnType, TrackMetadata } from '../../../types/interactionTypes'; import { BaseSlashCommandParams, BaseSlashCommandReturnType, TrackMetadata } from '../../types/interactionTypes';
import { checkQueueCurrentTrack, checkQueueExists } from '../../../utils/validation/queueValidator'; import { checkQueueCurrentTrack, checkQueueExists } from '../../utils/validation/queueValidator';
import { checkInVoiceChannel, checkSameVoiceChannel } from '../../../utils/validation/voiceChannelValidator'; import { checkInVoiceChannel, checkSameVoiceChannel } from '../../utils/validation/voiceChannelValidator';
import { localizeCommand, useServerTranslator } from '../../../common/localeUtil'; import { localizeCommand, useServerTranslator } from '../../common/localeUtil';
import { TFunction } from 'i18next'; import { TFunction } from 'i18next';
import { formatRepeatModeDetailed } from '../../../common/formattingUtils'; import { formatRepeatModeDetailed } from '../../common/formattingUtils';
class NowPlayingCommand extends BaseSlashCommandInteraction { class NowPlayingCommand extends BaseSlashCommandInteraction {
constructor() { constructor() {
@@ -1,11 +1,11 @@
import { GuildQueue, Track, useQueue } from 'discord-player'; import { GuildQueue, Track, useQueue } from 'discord-player';
import { EmbedBuilder, SlashCommandBuilder } from 'discord.js'; import { EmbedBuilder, SlashCommandBuilder } from 'discord.js';
import { Logger } from 'pino'; import { Logger } from 'pino';
import { BaseSlashCommandInteraction } from '../../../classes/interactions'; import { BaseSlashCommandInteraction } from '../../classes/interactions';
import { BaseSlashCommandParams, BaseSlashCommandReturnType } from '../../../types/interactionTypes'; import { BaseSlashCommandParams, BaseSlashCommandReturnType } from '../../types/interactionTypes';
import { checkQueueCurrentTrack, checkQueueExists } from '../../../utils/validation/queueValidator'; import { checkQueueCurrentTrack, checkQueueExists } from '../../utils/validation/queueValidator';
import { checkInVoiceChannel, checkSameVoiceChannel } from '../../../utils/validation/voiceChannelValidator'; import { checkInVoiceChannel, checkSameVoiceChannel } from '../../utils/validation/voiceChannelValidator';
import { localizeCommand, useServerTranslator } from '../../../common/localeUtil'; import { localizeCommand, useServerTranslator } from '../../common/localeUtil';
class PauseCommand extends BaseSlashCommandInteraction { class PauseCommand extends BaseSlashCommandInteraction {
constructor() { constructor() {
@@ -8,14 +8,14 @@ import {
SlashCommandBuilder SlashCommandBuilder
} from 'discord.js'; } from 'discord.js';
import { Logger } from 'pino'; import { Logger } from 'pino';
import { BaseSlashCommandInteraction, CustomError } from '../../../classes/interactions'; import { BaseSlashCommandInteraction, CustomError } from '../../classes/interactions';
import { BaseSlashCommandParams, BaseSlashCommandReturnType } from '../../../types/interactionTypes'; import { BaseSlashCommandParams, BaseSlashCommandReturnType } from '../../types/interactionTypes';
import { checkVoicePermissionJoinAndTalk } from '../../../utils/validation/permissionValidator'; import { checkVoicePermissionJoinAndTalk } from '../../utils/validation/permissionValidator';
import { transformQuery } from '../../../utils/validation/searchQueryValidator'; import { transformQuery } from '../../utils/validation/searchQueryValidator';
import { checkInVoiceChannel, checkSameVoiceChannel } from '../../../utils/validation/voiceChannelValidator'; import { checkInVoiceChannel, checkSameVoiceChannel } from '../../utils/validation/voiceChannelValidator';
import { localizeCommand, useServerTranslator } from '../../../common/localeUtil'; import { localizeCommand, useServerTranslator } from '../../common/localeUtil';
import { TFunction } from 'i18next'; import { TFunction } from 'i18next';
import { formatSlashCommand } from '../../../common/formattingUtils'; import { formatSlashCommand } from '../../common/formattingUtils';
class PlayCommand extends BaseSlashCommandInteraction { class PlayCommand extends BaseSlashCommandInteraction {
constructor() { constructor() {
@@ -12,12 +12,12 @@ import {
SlashCommandBuilder SlashCommandBuilder
} from 'discord.js'; } from 'discord.js';
import { Logger } from 'pino'; import { Logger } from 'pino';
import { BaseSlashCommandInteraction } from '../../../classes/interactions'; import { BaseSlashCommandInteraction } from '../../classes/interactions';
import { BaseSlashCommandParams, BaseSlashCommandReturnType } from '../../../types/interactionTypes'; import { BaseSlashCommandParams, BaseSlashCommandReturnType } from '../../types/interactionTypes';
import { checkQueueExists } from '../../../utils/validation/queueValidator'; import { checkQueueExists } from '../../utils/validation/queueValidator';
import { checkInVoiceChannel, checkSameVoiceChannel } from '../../../utils/validation/voiceChannelValidator'; import { checkInVoiceChannel, checkSameVoiceChannel } from '../../utils/validation/voiceChannelValidator';
import { formatDuration, formatRepeatModeDetailed, formatSlashCommand } from '../../../common/formattingUtils'; import { formatDuration, formatRepeatModeDetailed, formatSlashCommand } from '../../common/formattingUtils';
import { localizeCommand, useServerTranslator } from '../../../common/localeUtil'; import { localizeCommand, useServerTranslator } from '../../common/localeUtil';
import { TFunction } from 'i18next'; import { TFunction } from 'i18next';
class QueueCommand extends BaseSlashCommandInteraction { class QueueCommand extends BaseSlashCommandInteraction {
@@ -6,11 +6,11 @@ import {
SlashCommandBuilder SlashCommandBuilder
} from 'discord.js'; } from 'discord.js';
import { Logger } from 'pino'; import { Logger } from 'pino';
import { BaseSlashCommandInteraction } from '../../../classes/interactions'; import { BaseSlashCommandInteraction } from '../../classes/interactions';
import { ExtendedClient } from '../../../types/clientTypes'; import { ExtendedClient } from '../../types/clientTypes';
import { BaseSlashCommandParams, BaseSlashCommandReturnType } from '../../../types/interactionTypes'; import { BaseSlashCommandParams, BaseSlashCommandReturnType } from '../../types/interactionTypes';
import { checkValidGuildId } from '../../../utils/validation/systemCommandValidator'; import { checkValidGuildId } from '../../utils/validation/systemCommandValidator';
import { localizeCommand, useServerTranslator } from '../../../common/localeUtil'; import { localizeCommand, useServerTranslator } from '../../common/localeUtil';
import { TFunction } from 'i18next'; import { TFunction } from 'i18next';
class ReloadCommand extends BaseSlashCommandInteraction { class ReloadCommand extends BaseSlashCommandInteraction {
@@ -1,13 +1,13 @@
import { GuildQueue, Track, useQueue } from 'discord-player'; import { GuildQueue, Track, useQueue } from 'discord-player';
import { ChatInputCommandInteraction, EmbedBuilder, SlashCommandBuilder } from 'discord.js'; import { ChatInputCommandInteraction, EmbedBuilder, SlashCommandBuilder } from 'discord.js';
import { BaseSlashCommandInteraction } from '../../../classes/interactions'; import { BaseSlashCommandInteraction } from '../../classes/interactions';
import { BaseSlashCommandParams, BaseSlashCommandReturnType } from '../../../types/interactionTypes'; import { BaseSlashCommandParams, BaseSlashCommandReturnType } from '../../types/interactionTypes';
import { checkQueueExists } from '../../../utils/validation/queueValidator'; import { checkQueueExists } from '../../utils/validation/queueValidator';
import { checkInVoiceChannel, checkSameVoiceChannel } from '../../../utils/validation/voiceChannelValidator'; import { checkInVoiceChannel, checkSameVoiceChannel } from '../../utils/validation/voiceChannelValidator';
import { Logger } from 'pino'; import { Logger } from 'pino';
import { TFunction } from 'i18next'; import { TFunction } from 'i18next';
import { localizeCommand, useServerTranslator } from '../../../common/localeUtil'; import { localizeCommand, useServerTranslator } from '../../common/localeUtil';
import { formatSlashCommand } from '../../../common/formattingUtils'; import { formatSlashCommand } from '../../common/formattingUtils';
class RemoveCommand extends BaseSlashCommandInteraction { class RemoveCommand extends BaseSlashCommandInteraction {
constructor() { constructor() {
@@ -1,13 +1,13 @@
import { GuildQueue, useQueue } from 'discord-player'; import { GuildQueue, useQueue } from 'discord-player';
import { ChatInputCommandInteraction, EmbedBuilder, Message, SlashCommandBuilder } from 'discord.js'; import { ChatInputCommandInteraction, EmbedBuilder, Message, SlashCommandBuilder } from 'discord.js';
import { BaseSlashCommandInteraction } from '../../../classes/interactions'; import { BaseSlashCommandInteraction } from '../../classes/interactions';
import { BaseSlashCommandParams, BaseSlashCommandReturnType } from '../../../types/interactionTypes'; import { BaseSlashCommandParams, BaseSlashCommandReturnType } from '../../types/interactionTypes';
import { checkQueueCurrentTrack, checkQueueExists } from '../../../utils/validation/queueValidator'; import { checkQueueCurrentTrack, checkQueueExists } from '../../utils/validation/queueValidator';
import { checkInVoiceChannel, checkSameVoiceChannel } from '../../../utils/validation/voiceChannelValidator'; import { checkInVoiceChannel, checkSameVoiceChannel } from '../../utils/validation/voiceChannelValidator';
import { Logger } from 'pino'; import { Logger } from 'pino';
import { localizeCommand, useServerTranslator } from '../../../common/localeUtil'; import { localizeCommand, useServerTranslator } from '../../common/localeUtil';
import { TFunction } from 'i18next'; import { TFunction } from 'i18next';
import { formatSlashCommand } from '../../../common/formattingUtils'; import { formatSlashCommand } from '../../common/formattingUtils';
class SeekCommand extends BaseSlashCommandInteraction { class SeekCommand extends BaseSlashCommandInteraction {
constructor() { constructor() {
@@ -5,12 +5,12 @@ import {
EmbedFooterData, EmbedFooterData,
SlashCommandBuilder SlashCommandBuilder
} from 'discord.js'; } from 'discord.js';
import { BaseSlashCommandInteraction } from '../../../classes/interactions'; import { BaseSlashCommandInteraction } from '../../classes/interactions';
import { ExtendedClient } from '../../../types/clientTypes'; import { ExtendedClient } from '../../types/clientTypes';
import { BaseSlashCommandParams, BaseSlashCommandReturnType, ShardInfo } from '../../../types/interactionTypes'; import { BaseSlashCommandParams, BaseSlashCommandReturnType, ShardInfo } from '../../types/interactionTypes';
import { checkValidGuildId } from '../../../utils/validation/systemCommandValidator'; import { checkValidGuildId } from '../../utils/validation/systemCommandValidator';
import { Logger } from 'pino'; import { Logger } from 'pino';
import { localizeCommand } from '../../../common/localeUtil'; import { localizeCommand } from '../../common/localeUtil';
class ShardsCommand extends BaseSlashCommandInteraction { class ShardsCommand extends BaseSlashCommandInteraction {
constructor() { constructor() {
@@ -1,11 +1,11 @@
import { GuildQueue, useQueue } from 'discord-player'; import { GuildQueue, useQueue } from 'discord-player';
import { EmbedBuilder, SlashCommandBuilder } from 'discord.js'; import { EmbedBuilder, SlashCommandBuilder } from 'discord.js';
import { BaseSlashCommandInteraction } from '../../../classes/interactions'; import { BaseSlashCommandInteraction } from '../../classes/interactions';
import { BaseSlashCommandParams, BaseSlashCommandReturnType } from '../../../types/interactionTypes'; import { BaseSlashCommandParams, BaseSlashCommandReturnType } from '../../types/interactionTypes';
import { checkQueueEmpty, checkQueueExists } from '../../../utils/validation/queueValidator'; import { checkQueueEmpty, checkQueueExists } from '../../utils/validation/queueValidator';
import { checkInVoiceChannel, checkSameVoiceChannel } from '../../../utils/validation/voiceChannelValidator'; import { checkInVoiceChannel, checkSameVoiceChannel } from '../../utils/validation/voiceChannelValidator';
import { localizeCommand, useServerTranslator } from '../../../common/localeUtil'; import { localizeCommand, useServerTranslator } from '../../common/localeUtil';
import { formatSlashCommand } from '../../../common/formattingUtils'; import { formatSlashCommand } from '../../common/formattingUtils';
class ShuffleCommand extends BaseSlashCommandInteraction { class ShuffleCommand extends BaseSlashCommandInteraction {
constructor() { constructor() {
@@ -1,13 +1,13 @@
import { GuildQueue, Track, useQueue } from 'discord-player'; import { GuildQueue, Track, useQueue } from 'discord-player';
import { ChatInputCommandInteraction, EmbedBuilder, SlashCommandBuilder } from 'discord.js'; import { ChatInputCommandInteraction, EmbedBuilder, SlashCommandBuilder } from 'discord.js';
import { BaseSlashCommandInteraction } from '../../../classes/interactions'; import { BaseSlashCommandInteraction } from '../../classes/interactions';
import { BaseSlashCommandParams, BaseSlashCommandReturnType } from '../../../types/interactionTypes'; import { BaseSlashCommandParams, BaseSlashCommandReturnType } from '../../types/interactionTypes';
import { checkQueueCurrentTrack, checkQueueExists } from '../../../utils/validation/queueValidator'; import { checkQueueCurrentTrack, checkQueueExists } from '../../utils/validation/queueValidator';
import { checkInVoiceChannel, checkSameVoiceChannel } from '../../../utils/validation/voiceChannelValidator'; import { checkInVoiceChannel, checkSameVoiceChannel } from '../../utils/validation/voiceChannelValidator';
import { Logger } from 'pino'; import { Logger } from 'pino';
import { localizeCommand, useServerTranslator } from '../../../common/localeUtil'; import { localizeCommand, useServerTranslator } from '../../common/localeUtil';
import { TFunction } from 'i18next'; import { TFunction } from 'i18next';
import { formatRepeatModeDetailed, formatSlashCommand } from '../../../common/formattingUtils'; import { formatRepeatModeDetailed, formatSlashCommand } from '../../common/formattingUtils';
class SkipCommand extends BaseSlashCommandInteraction { class SkipCommand extends BaseSlashCommandInteraction {
constructor() { constructor() {
@@ -1,5 +1,5 @@
// @ts-ignore // @ts-ignore
import { version } from '../../../../package.json'; import { version } from '../../../package.json';
import { import {
APIActionRowComponent, APIActionRowComponent,
APIButtonComponent, APIButtonComponent,
@@ -10,10 +10,10 @@ import {
EmbedBuilder, EmbedBuilder,
SlashCommandBuilder SlashCommandBuilder
} from 'discord.js'; } from 'discord.js';
import { BaseSlashCommandInteraction } from '../../../classes/interactions'; import { BaseSlashCommandInteraction } from '../../classes/interactions';
import { getBotStatistics, getDiscordStatus, getPlayerStatistics, getSystemStatus } from '../../../common/statusUtils'; import { getBotStatistics, getDiscordStatus, getPlayerStatistics, getSystemStatus } from '../../common/statusUtils';
import { BaseSlashCommandParams, BaseSlashCommandReturnType } from '../../../types/interactionTypes'; import { BaseSlashCommandParams, BaseSlashCommandReturnType } from '../../types/interactionTypes';
import { localizeCommand, useServerTranslator } from '../../../common/localeUtil'; import { localizeCommand, useServerTranslator } from '../../common/localeUtil';
class StatusCommand extends BaseSlashCommandInteraction { class StatusCommand extends BaseSlashCommandInteraction {
constructor() { constructor() {
@@ -1,11 +1,11 @@
import { GuildQueue, QueueRepeatMode, useQueue } from 'discord-player'; import { GuildQueue, QueueRepeatMode, useQueue } from 'discord-player';
import { EmbedBuilder, SlashCommandBuilder } from 'discord.js'; import { EmbedBuilder, SlashCommandBuilder } from 'discord.js';
import { BaseSlashCommandInteraction } from '../../../classes/interactions'; import { BaseSlashCommandInteraction } from '../../classes/interactions';
import { BaseSlashCommandParams, BaseSlashCommandReturnType } from '../../../types/interactionTypes'; import { BaseSlashCommandParams, BaseSlashCommandReturnType } from '../../types/interactionTypes';
import { checkQueueExists } from '../../../utils/validation/queueValidator'; import { checkQueueExists } from '../../utils/validation/queueValidator';
import { checkInVoiceChannel, checkSameVoiceChannel } from '../../../utils/validation/voiceChannelValidator'; import { checkInVoiceChannel, checkSameVoiceChannel } from '../../utils/validation/voiceChannelValidator';
import { localizeCommand, useServerTranslator } from '../../../common/localeUtil'; import { localizeCommand, useServerTranslator } from '../../common/localeUtil';
import { formatSlashCommand } from '../../../common/formattingUtils'; import { formatSlashCommand } from '../../common/formattingUtils';
class StopCommand extends BaseSlashCommandInteraction { class StopCommand extends BaseSlashCommandInteraction {
constructor() { constructor() {
@@ -1,11 +1,11 @@
// @ts-ignore // @ts-ignore
import { dependencies, version } from '../../../../package.json'; import { dependencies, version } from '../../../package.json';
import { EmbedBuilder, SlashCommandBuilder } from 'discord.js'; import { EmbedBuilder, SlashCommandBuilder } from 'discord.js';
import { BaseSlashCommandInteraction } from '../../../classes/interactions'; import { BaseSlashCommandInteraction } from '../../classes/interactions';
import { getBotStatistics, getDiscordStatus, getPlayerStatistics, getSystemStatus } from '../../../common/statusUtils'; import { getBotStatistics, getDiscordStatus, getPlayerStatistics, getSystemStatus } from '../../common/statusUtils';
import { BaseSlashCommandParams, BaseSlashCommandReturnType } from '../../../types/interactionTypes'; import { BaseSlashCommandParams, BaseSlashCommandReturnType } from '../../types/interactionTypes';
import { checkValidGuildId } from '../../../utils/validation/systemCommandValidator'; import { checkValidGuildId } from '../../utils/validation/systemCommandValidator';
import { localizeCommand, useServerTranslator } from '../../../common/localeUtil'; import { localizeCommand, useServerTranslator } from '../../common/localeUtil';
class SystemStatusCommand extends BaseSlashCommandInteraction { class SystemStatusCommand extends BaseSlashCommandInteraction {
constructor() { constructor() {
@@ -1,11 +1,11 @@
import { GuildQueue, useQueue } from 'discord-player'; import { GuildQueue, useQueue } from 'discord-player';
import { ChatInputCommandInteraction, EmbedBuilder, SlashCommandBuilder } from 'discord.js'; import { ChatInputCommandInteraction, EmbedBuilder, SlashCommandBuilder } from 'discord.js';
import { BaseSlashCommandInteraction } from '../../../classes/interactions'; import { BaseSlashCommandInteraction } from '../../classes/interactions';
import { BaseSlashCommandParams, BaseSlashCommandReturnType } from '../../../types/interactionTypes'; import { BaseSlashCommandParams, BaseSlashCommandReturnType } from '../../types/interactionTypes';
import { checkQueueExists } from '../../../utils/validation/queueValidator'; import { checkQueueExists } from '../../utils/validation/queueValidator';
import { checkInVoiceChannel, checkSameVoiceChannel } from '../../../utils/validation/voiceChannelValidator'; import { checkInVoiceChannel, checkSameVoiceChannel } from '../../utils/validation/voiceChannelValidator';
import { Logger } from 'pino'; import { Logger } from 'pino';
import { localizeCommand, useServerTranslator } from '../../../common/localeUtil'; import { localizeCommand, useServerTranslator } from '../../common/localeUtil';
import { TFunction } from 'i18next'; import { TFunction } from 'i18next';
class VolumeCommand extends BaseSlashCommandInteraction { class VolumeCommand extends BaseSlashCommandInteraction {
+1 -1
View File
@@ -1,4 +1,4 @@
import helpCommand from '../interactions/commands/info/help'; import helpCommand from '../interactions/slashcommands/help';
import { SlashCommandNumberOption } from 'discord.js'; import { SlashCommandNumberOption } from 'discord.js';
import { BaseSlashCommandInteraction } from '../classes/interactions'; import { BaseSlashCommandInteraction } from '../classes/interactions';
+2 -5
View File
@@ -20,7 +20,6 @@ const logger: Logger = loggerModule.child({
const userSlashCommands: RESTPostAPIChatInputApplicationCommandsJSONBody[] = []; const userSlashCommands: RESTPostAPIChatInputApplicationCommandsJSONBody[] = [];
const systemSlashCommands: RESTPostAPIChatInputApplicationCommandsJSONBody[] = []; const systemSlashCommands: RESTPostAPIChatInputApplicationCommandsJSONBody[] = [];
const commandFolders: string[] = fs.readdirSync(path.resolve('./dist/interactions/commands'));
if (!process.env.DISCORD_BOT_TOKEN) { if (!process.env.DISCORD_BOT_TOKEN) {
throw new Error('DISCORD_BOT_TOKEN environment variable is not set.'); throw new Error('DISCORD_BOT_TOKEN environment variable is not set.');
@@ -40,19 +39,17 @@ const rest: REST = new REST({ version: '10' }).setToken(process.env.DISCORD_BOT_
process.exit(1); process.exit(1);
} }
for (const folder of commandFolders) {
const commandFiles: string[] = fs const commandFiles: string[] = fs
.readdirSync(path.resolve(`./dist/interactions/commands/${folder}`)) .readdirSync(path.resolve('./dist/interactions/slashcommands'))
.filter((file) => file.endsWith('.js')); .filter((file) => file.endsWith('.js'));
for (const file of commandFiles) { for (const file of commandFiles) {
const { default: command } = await import(`../interactions/commands/${folder}/${file}`); const { default: command } = await import(`../interactions/slashcommands/${file}`);
const slashCommand = command as BaseSlashCommandInteraction; const slashCommand = command as BaseSlashCommandInteraction;
slashCommand.isSystemCommand slashCommand.isSystemCommand
? systemSlashCommands.push(slashCommand.data.toJSON()) ? systemSlashCommands.push(slashCommand.data.toJSON())
: userSlashCommands.push(slashCommand.data.toJSON()); : userSlashCommands.push(slashCommand.data.toJSON());
} }
}
try { try {
logger.debug( logger.debug(
+5 -12
View File
@@ -25,19 +25,15 @@ async function registerSlashCommandInteractions(logger: Logger, client: Extended
logger.debug('Registering client slash command interactions...'); logger.debug('Registering client slash command interactions...');
client.slashCommandInteractions = new Collection(); client.slashCommandInteractions = new Collection();
const baseFolderPath = './dist/interactions/commands'; const basePath = './dist/interactions/slashcommands';
const slashCommandInteractionFolders: string[] = fs.readdirSync(path.resolve(baseFolderPath));
for (const categoryFolder of slashCommandInteractionFolders) { logger.trace('Registering client commands...');
logger.trace(`Registering client commands for folder '${categoryFolder}'...`);
const files: string[] = fs const files: string[] = fs.readdirSync(path.resolve(`${basePath}`)).filter((file) => file.endsWith('.js'));
.readdirSync(path.resolve(`${baseFolderPath}/${categoryFolder}`))
.filter((file) => file.endsWith('.js'));
for (const file of files) { for (const file of files) {
try { try {
const filePath = path.resolve(`${baseFolderPath}/${categoryFolder}/${file}`); const filePath = path.resolve(`${basePath}/${file}`);
// delete require cache for file // delete require cache for file
delete require.cache[filePath]; delete require.cache[filePath];
@@ -48,15 +44,12 @@ async function registerSlashCommandInteractions(logger: Logger, client: Extended
client.slashCommandInteractions.set(slashCommandInteraction.name, slashCommandInteraction); client.slashCommandInteractions.set(slashCommandInteraction.name, slashCommandInteraction);
} catch (error) { } catch (error) {
if (error instanceof Error) { if (error instanceof Error) {
logger.error( logger.error(`Error registering slash command interaction '${file}': ${error.message}`);
`Error registering slash command interaction '${categoryFolder}/${file}': ${error.message}`
);
} else { } else {
throw error; throw error;
} }
} }
} }
}
logger.trace('Registering client slash command interactions complete.'); logger.trace('Registering client slash command interactions complete.');
} }