fix: separated types and classes

This commit is contained in:
Marius Begby committed 2023-09-03 02:19:28 +02:00
1 parent 6dcddee2e9
commit ea32ae6c61
42 files changed
+234 -296

No files matched your search

@@ -1,6 +1,7 @@
import { GuildQueue, useQueue } from 'discord-player';
import { EmbedBuilder, GuildMember } from 'discord.js';
import { BaseComponentInteraction, BaseComponentParams, BaseComponentReturnType } from '../../types/interactionTypes';
import { BaseComponentParams, BaseComponentReturnType } from '../../types/interactionTypes';
import { BaseComponentInteraction } from '../../classes/interactions';
import { queueDoesNotExist } from '../../utils/validation/queueValidator';
import { notInSameVoiceChannel, notInVoiceChannel } from '../../utils/validation/voiceChannelValidator';
@@ -2,7 +2,8 @@ import config from 'config';
import { GuildQueue, QueueFilters, useQueue } from 'discord-player';
import { EmbedBuilder, GuildMember, StringSelectMenuInteraction } from 'discord.js';
import { FFmpegFilterOption, FFmpegFilterOptions } from '../../types/configTypes';
import { BaseComponentInteraction, BaseComponentParams, BaseComponentReturnType } from '../../types/interactionTypes';
import { BaseComponentParams, BaseComponentReturnType } from '../../types/interactionTypes';
import { BaseComponentInteraction } from '../../classes/interactions';
import { queueDoesNotExist } from '../../utils/validation/queueValidator';
import { notInSameVoiceChannel, notInVoiceChannel } from '../../utils/validation/voiceChannelValidator';
const ffmpegFilterOptions: FFmpegFilterOptions = config.get('ffmpegFilterOptions');
@@ -1,6 +1,7 @@
import { GuildQueue, Track, useQueue } from 'discord-player';
import { EmbedBuilder, GuildMember } from 'discord.js';
import { BaseComponentInteraction, BaseComponentParams, BaseComponentReturnType } from '../../types/interactionTypes';
import { BaseComponentParams, BaseComponentReturnType } from '../../types/interactionTypes';
import { BaseComponentInteraction } from '../../classes/interactions';
import { queueDoesNotExist, queueNoCurrentTrack } from '../../utils/validation/queueValidator';
import { notInSameVoiceChannel, notInVoiceChannel } from '../../utils/validation/voiceChannelValidator';
@@ -79,7 +80,14 @@ class NowplayingSkipButton extends BaseComponentInteraction {
[3, 'autoplay']
]);
const repeatModeUserString: string = loopModesFormatted.get(queue.repeatMode)!;
const loopModeUserString: string = loopModesFormatted.get(queue.repeatMode)!;
const getRepeatModeMessage = (repeatMode: number): string => {
const icon = repeatMode === 3 ? this.embedOptions.icons.autoplaying : this.embedOptions.icons.looping;
return `**${icon} Looping**\nLoop mode is set to **\`${loopModeUserString}\`**. You can change it with **\`/loop\`**.`;
};
const repeatModeString: string = queue.repeatMode === 0 ? '' : getRepeatModeMessage(queue.repeatMode);
let authorName: string;
@@ -100,16 +108,7 @@ class NowplayingSkipButton extends BaseComponentInteraction {
.setDescription(
`**${this.embedOptions.icons.skipped} Skipped track**\n**${durationFormat} [${
skippedTrack.title
}](${skippedTrack.raw.url ?? skippedTrack.url})**` +
`${
queue.repeatMode === 0
? ''
: `\n\n**${
queue.repeatMode === 3
? this.embedOptions.icons.autoplaying
: this.embedOptions.icons.looping
} Looping**\nLoop mode is set to ${repeatModeUserString}. You can change it with **\`/loop\`**.`
}`
}](${skippedTrack.raw.url ?? skippedTrack.url})**` + `\n\n${repeatModeString}`
)
.setThumbnail(skippedTrack.thumbnail)
.setColor(this.embedOptions.colors.success)