mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-03 06:28:53 +00:00
fix: remove Promise.resolve() return and fix queue type
This commit is contained in:
1 parent
d5cc5b8741
commit
67e45729a3
23 files changed
+102
-117
No files matched your search
@@ -24,7 +24,7 @@ export const handleCommand = async (
|
||||
}
|
||||
|
||||
if (await cannotSendMessageInChannel({ interaction, executionId })) {
|
||||
return Promise.resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
logger.debug('Executing command interaction.');
|
||||
|
||||
@@ -39,37 +39,28 @@ const command: CustomSlashCommandInteraction = {
|
||||
let totalTracks: number = 0;
|
||||
let totalListeners: number = 0;
|
||||
|
||||
await client!.shard!
|
||||
.broadcastEval(() => {
|
||||
await client!
|
||||
.shard!.broadcastEval(() => {
|
||||
/* eslint-disable no-undef */
|
||||
return player.generateStatistics();
|
||||
})
|
||||
.then((results) => {
|
||||
const queueCountList: number[] = [];
|
||||
const trackCountList: number[] = [];
|
||||
const listenerCountList: number[] = [];
|
||||
results.map((result) => {
|
||||
queueCountList.push(result.queues.length);
|
||||
if (result.queues.length > 0) {
|
||||
result.queues.map((queue) => {
|
||||
trackCountList.push(queue.status.playing ? queue.tracksCount + 1 : queue.tracksCount);
|
||||
listenerCountList.push(queue.listeners);
|
||||
});
|
||||
}
|
||||
activeVoiceConnections += result.queues.length;
|
||||
result.queues.map((queue) => {
|
||||
totalTracks += queue.status.playing ? queue.tracksCount + 1 : queue.tracksCount;
|
||||
totalListeners += queue.listeners;
|
||||
});
|
||||
});
|
||||
|
||||
activeVoiceConnections = queueCountList.reduce((acc, queueAmount) => acc + queueAmount, 0);
|
||||
totalTracks = trackCountList.reduce((acc, trackAmount) => acc + trackAmount, 0);
|
||||
totalListeners = listenerCountList.reduce((acc, listenerAmount) => acc + listenerAmount, 0);
|
||||
|
||||
logger.debug('Successfully fetched player statistics from shards.');
|
||||
})
|
||||
.catch((error) => {
|
||||
logger.error(error, 'Failed to fetch player statistics from shards.');
|
||||
});
|
||||
|
||||
await client!.shard!
|
||||
.fetchClientValues('guilds.cache')
|
||||
await client!
|
||||
.shard!.fetchClientValues('guilds.cache')
|
||||
.then((results) => {
|
||||
const guildCaches = results as Guild[][];
|
||||
guildCaches.map((guildCache: Guild[]) => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import config from 'config';
|
||||
import { NodeResolvable, QueueFilters, useQueue } from 'discord-player';
|
||||
import { GuildQueue, QueueFilters, useQueue } from 'discord-player';
|
||||
import {
|
||||
APIActionRowComponent,
|
||||
APIMessageActionRowComponent,
|
||||
@@ -40,21 +40,21 @@ const command: CustomSlashCommandInteraction = {
|
||||
});
|
||||
|
||||
if (await notInVoiceChannel({ interaction, executionId })) {
|
||||
return Promise.resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
const queue: NodeResolvable = useQueue(interaction.guild!.id)!;
|
||||
const queue: GuildQueue = useQueue(interaction.guild!.id)!;
|
||||
|
||||
if (await queueDoesNotExist({ interaction, queue, executionId })) {
|
||||
return Promise.resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
if (await notInSameVoiceChannel({ interaction, queue, executionId })) {
|
||||
return Promise.resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
if (await queueNoCurrentTrack({ interaction, queue, executionId })) {
|
||||
return Promise.resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
const filterOptions: StringSelectMenuOptionBuilder[] = [];
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import config from 'config';
|
||||
import { NodeResolvable, useQueue } from 'discord-player';
|
||||
import { GuildQueue, useQueue } from 'discord-player';
|
||||
import { EmbedBuilder, GuildMember, SlashCommandBuilder } from 'discord.js';
|
||||
|
||||
import loggerModule from '../../../services/logger';
|
||||
@@ -28,10 +28,10 @@ const command: CustomSlashCommandInteraction = {
|
||||
});
|
||||
|
||||
if (await notInVoiceChannel({ interaction, executionId })) {
|
||||
return Promise.resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
const queue: NodeResolvable = useQueue(interaction.guild!.id)!;
|
||||
const queue: GuildQueue = useQueue(interaction.guild!.id)!;
|
||||
|
||||
if (!queue) {
|
||||
logger.debug('There is already no queue.');
|
||||
@@ -49,7 +49,7 @@ const command: CustomSlashCommandInteraction = {
|
||||
}
|
||||
|
||||
if (await notInSameVoiceChannel({ interaction, queue, executionId })) {
|
||||
return Promise.resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!queue.deleted) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import config from 'config';
|
||||
import { NodeResolvable, useQueue } from 'discord-player';
|
||||
import { GuildQueue, useQueue } from 'discord-player';
|
||||
import { EmbedBuilder, GuildMember, SlashCommandBuilder, SlashCommandStringOption } from 'discord.js';
|
||||
|
||||
import loggerModule from '../../../services/logger';
|
||||
@@ -42,17 +42,17 @@ const command: CustomSlashCommandInteraction = {
|
||||
});
|
||||
|
||||
if (await notInVoiceChannel({ interaction, executionId })) {
|
||||
return Promise.resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
const queue: NodeResolvable = useQueue(interaction.guild!.id)!;
|
||||
const queue: GuildQueue = useQueue(interaction.guild!.id)!;
|
||||
|
||||
if (await queueDoesNotExist({ interaction, queue, executionId })) {
|
||||
return Promise.resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
if (await notInSameVoiceChannel({ interaction, queue, executionId })) {
|
||||
return Promise.resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
const loopModesFormatted = new Map([
|
||||
@@ -132,6 +132,7 @@ const command: CustomSlashCommandInteraction = {
|
||||
if (queue.repeatMode === 0) {
|
||||
logger.debug('Disabled loop mode.');
|
||||
|
||||
// TODO: Different text when disabling autoplay.
|
||||
logger.debug('Responding with success embed.');
|
||||
return await interaction.editReply({
|
||||
embeds: [
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import config from 'config';
|
||||
import { NodeResolvable, QueryType, useMainPlayer, useQueue } from 'discord-player';
|
||||
import { GuildQueue, QueryType, useMainPlayer, useQueue } from 'discord-player';
|
||||
import { EmbedBuilder, SlashCommandBuilder } from 'discord.js';
|
||||
|
||||
import { lyricsExtractor } from '@discord-player/extractor';
|
||||
@@ -43,24 +43,24 @@ const command: CustomSlashCommandInteraction = {
|
||||
});
|
||||
|
||||
const query = interaction.options.getString('query');
|
||||
const queue: NodeResolvable = useQueue(interaction.guild!.id)!;
|
||||
const queue: GuildQueue = useQueue(interaction.guild!.id)!;
|
||||
let geniusSearchQuery = '';
|
||||
|
||||
if (!query) {
|
||||
if (await notInVoiceChannel({ interaction, executionId })) {
|
||||
return Promise.resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
if (await queueDoesNotExist({ interaction, queue, executionId })) {
|
||||
return Promise.resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
if (await notInSameVoiceChannel({ interaction, queue, executionId })) {
|
||||
return Promise.resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
if (await queueNoCurrentTrack({ interaction, queue, executionId })) {
|
||||
return Promise.resolve();
|
||||
return;
|
||||
}
|
||||
geniusSearchQuery = queue.currentTrack!.title.slice(0, 50);
|
||||
|
||||
@@ -188,7 +188,7 @@ const command: CustomSlashCommandInteraction = {
|
||||
}
|
||||
}
|
||||
|
||||
return Promise.resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
logger.debug('Responding with info embed.');
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import config from 'config';
|
||||
import { NodeResolvable, Track, useQueue } from 'discord-player';
|
||||
import { GuildQueue, Track, useQueue } from 'discord-player';
|
||||
import {
|
||||
APIActionRowComponent,
|
||||
APIMessageActionRowComponent,
|
||||
@@ -38,21 +38,21 @@ const command: CustomSlashCommandInteraction = {
|
||||
});
|
||||
|
||||
if (await notInVoiceChannel({ interaction, executionId })) {
|
||||
return Promise.resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
const queue: NodeResolvable = useQueue(interaction.guild!.id)!;
|
||||
const queue: GuildQueue = useQueue(interaction.guild!.id)!;
|
||||
|
||||
if (await queueDoesNotExist({ interaction, queue, executionId })) {
|
||||
return Promise.resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
if (await notInSameVoiceChannel({ interaction, queue, executionId })) {
|
||||
return Promise.resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
if (await queueNoCurrentTrack({ interaction, queue, executionId })) {
|
||||
return Promise.resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
const sourceStringsFormatted = new Map([
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import config from 'config';
|
||||
import { NodeResolvable, useQueue } from 'discord-player';
|
||||
import { GuildQueue, useQueue } from 'discord-player';
|
||||
import { EmbedBuilder, GuildMember, SlashCommandBuilder } from 'discord.js';
|
||||
|
||||
import loggerModule from '../../../services/logger';
|
||||
@@ -29,21 +29,21 @@ const command: CustomSlashCommandInteraction = {
|
||||
});
|
||||
|
||||
if (await notInVoiceChannel({ interaction, executionId })) {
|
||||
return Promise.resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
const queue: NodeResolvable = useQueue(interaction.guild!.id)!;
|
||||
const queue: GuildQueue = useQueue(interaction.guild!.id)!;
|
||||
|
||||
if (await queueDoesNotExist({ interaction, queue, executionId })) {
|
||||
return Promise.resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
if (await notInSameVoiceChannel({ interaction, queue, executionId })) {
|
||||
return Promise.resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
if (await queueNoCurrentTrack({ interaction, queue, executionId })) {
|
||||
return Promise.resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
const currentTrack = queue.currentTrack!;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import config from 'config';
|
||||
import { useMainPlayer, useQueue } from 'discord-player';
|
||||
import { GuildQueue, useMainPlayer, useQueue } from 'discord-player';
|
||||
import { EmbedBuilder, GuildMember, SlashCommandBuilder } from 'discord.js';
|
||||
|
||||
import loggerModule from '../../../services/logger';
|
||||
@@ -43,17 +43,18 @@ const command: CustomSlashCommandInteraction = {
|
||||
guildId: interaction.guild?.id
|
||||
});
|
||||
|
||||
|
||||
if (await notInVoiceChannel({ interaction, executionId })) {
|
||||
return Promise.resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
if (await cannotJoinVoiceOrTalk({ interaction, executionId })) {
|
||||
return Promise.resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
let queue = useQueue(interaction.guild!.id);
|
||||
let queue: GuildQueue = useQueue(interaction.guild!.id)!;
|
||||
if (queue && (await notInSameVoiceChannel({ interaction, queue, executionId }))) {
|
||||
return Promise.resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
const player = useMainPlayer()!;
|
||||
@@ -86,7 +87,7 @@ const command: CustomSlashCommandInteraction = {
|
||||
});
|
||||
}
|
||||
|
||||
queue = useQueue(interaction.guild!.id);
|
||||
queue = useQueue(interaction.guild!.id)!;
|
||||
const queueSize = queue?.size ?? 0;
|
||||
|
||||
if ((searchResult.playlist! && searchResult.tracks.length) > playerOptions.maxQueueSize - queueSize) {
|
||||
@@ -211,7 +212,7 @@ const command: CustomSlashCommandInteraction = {
|
||||
|
||||
logger.debug(`Successfully added track with player.play(). Query: '${query}'.`);
|
||||
|
||||
queue = useQueue(interaction.guild!.id);
|
||||
queue = useQueue(interaction.guild!.id)!;
|
||||
|
||||
if (!queue || !track) {
|
||||
logger.warn(`After player.play(), queue is undefined. Query: '${query}'.`);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import config from 'config';
|
||||
import { NodeResolvable, useQueue } from 'discord-player';
|
||||
import { GuildQueue, useQueue } from 'discord-player';
|
||||
import { EmbedBuilder, SlashCommandBuilder } from 'discord.js';
|
||||
|
||||
import loggerModule from '../../../services/logger';
|
||||
@@ -30,13 +30,13 @@ const command: CustomSlashCommandInteraction = {
|
||||
});
|
||||
|
||||
if (await notInVoiceChannel({ interaction, executionId })) {
|
||||
return Promise.resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
const queue: NodeResolvable = useQueue(interaction.guild!.id)!;
|
||||
const queue: GuildQueue = useQueue(interaction.guild!.id)!;
|
||||
|
||||
if (await notInSameVoiceChannel({ interaction, queue, executionId })) {
|
||||
return Promise.resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
const pageIndex = (interaction.options.getNumber('page') || 1) - 1;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import config from 'config';
|
||||
import { NodeResolvable, useQueue } from 'discord-player';
|
||||
import { GuildQueue, useQueue } from 'discord-player';
|
||||
import { EmbedBuilder, GuildMember, SlashCommandBuilder } from 'discord.js';
|
||||
|
||||
import loggerModule from '../../../services/logger';
|
||||
@@ -35,21 +35,21 @@ const command: CustomSlashCommandInteraction = {
|
||||
});
|
||||
|
||||
if (await notInVoiceChannel({ interaction, executionId })) {
|
||||
return Promise.resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
const queue: NodeResolvable = useQueue(interaction.guild!.id)!;
|
||||
const queue: GuildQueue = useQueue(interaction.guild!.id)!;
|
||||
|
||||
if (await queueDoesNotExist({ interaction, queue, executionId })) {
|
||||
return Promise.resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
if (await notInSameVoiceChannel({ interaction, queue, executionId })) {
|
||||
return Promise.resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
if (await queueNoCurrentTrack({ interaction, queue, executionId })) {
|
||||
return Promise.resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
const durationInput = interaction.options.getString('duration');
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import config from 'config';
|
||||
import { NodeResolvable, useQueue } from 'discord-player';
|
||||
import { GuildQueue, useQueue } from 'discord-player';
|
||||
import { EmbedBuilder, GuildMember, SlashCommandBuilder } from 'discord.js';
|
||||
|
||||
import loggerModule from '../../../services/logger';
|
||||
@@ -29,21 +29,21 @@ const command: CustomSlashCommandInteraction = {
|
||||
});
|
||||
|
||||
if (await notInVoiceChannel({ interaction, executionId })) {
|
||||
return Promise.resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
const queue: NodeResolvable = useQueue(interaction.guild!.id)!;
|
||||
const queue: GuildQueue = useQueue(interaction.guild!.id)!;
|
||||
|
||||
if (await queueDoesNotExist({ interaction, queue, executionId })) {
|
||||
return Promise.resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
if (await notInSameVoiceChannel({ interaction, queue, executionId })) {
|
||||
return Promise.resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
if (await queueIsEmpty({ interaction, queue, executionId })) {
|
||||
return Promise.resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
queue.tracks.shuffle();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import config from 'config';
|
||||
import { NodeResolvable, useQueue } from 'discord-player';
|
||||
import { GuildQueue, useQueue } from 'discord-player';
|
||||
import { EmbedBuilder, GuildMember, SlashCommandBuilder } from 'discord.js';
|
||||
|
||||
import loggerModule from '../../../services/logger';
|
||||
@@ -32,21 +32,21 @@ const command: CustomSlashCommandInteraction = {
|
||||
});
|
||||
|
||||
if (await notInVoiceChannel({ interaction, executionId })) {
|
||||
return Promise.resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
const queue: NodeResolvable = useQueue(interaction.guild!.id)!;
|
||||
const queue: GuildQueue = useQueue(interaction.guild!.id)!;
|
||||
|
||||
if (await queueDoesNotExist({ interaction, queue, executionId })) {
|
||||
return Promise.resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
if (await notInSameVoiceChannel({ interaction, queue, executionId })) {
|
||||
return Promise.resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
if (await queueNoCurrentTrack({ interaction, queue, executionId })) {
|
||||
return Promise.resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
const skipToTrack = interaction.options.getNumber('tracknumber');
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import config from 'config';
|
||||
import { NodeResolvable, useQueue } from 'discord-player';
|
||||
import { GuildQueue, useQueue } from 'discord-player';
|
||||
import { EmbedBuilder, GuildMember, SlashCommandBuilder } from 'discord.js';
|
||||
|
||||
import loggerModule from '../../../services/logger';
|
||||
@@ -28,10 +28,10 @@ const command: CustomSlashCommandInteraction = {
|
||||
});
|
||||
|
||||
if (await notInVoiceChannel({ interaction, executionId })) {
|
||||
return Promise.resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
const queue: NodeResolvable = useQueue(interaction.guild!.id)!;
|
||||
const queue: GuildQueue = useQueue(interaction.guild!.id)!;
|
||||
|
||||
if (!queue) {
|
||||
logger.debug('There is no queue.');
|
||||
@@ -49,7 +49,7 @@ const command: CustomSlashCommandInteraction = {
|
||||
}
|
||||
|
||||
if (await notInSameVoiceChannel({ interaction, queue, executionId })) {
|
||||
return Promise.resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!queue.deleted) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import config from 'config';
|
||||
import { NodeResolvable, useQueue } from 'discord-player';
|
||||
import { GuildQueue, useQueue } from 'discord-player';
|
||||
import { EmbedBuilder, GuildMember, SlashCommandBuilder } from 'discord.js';
|
||||
|
||||
import loggerModule from '../../../services/logger';
|
||||
@@ -36,17 +36,17 @@ const command: CustomSlashCommandInteraction = {
|
||||
});
|
||||
|
||||
if (await notInVoiceChannel({ interaction, executionId })) {
|
||||
return Promise.resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
const queue: NodeResolvable = useQueue(interaction.guild!.id)!;
|
||||
const queue: GuildQueue = useQueue(interaction.guild!.id)!;
|
||||
|
||||
if (await queueDoesNotExist({ interaction, queue, executionId })) {
|
||||
return Promise.resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
if (await notInSameVoiceChannel({ interaction, queue, executionId })) {
|
||||
return Promise.resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
const volume = interaction.options.getNumber('percentage');
|
||||
|
||||
@@ -28,7 +28,7 @@ const command: CustomSlashCommandInteraction = {
|
||||
});
|
||||
|
||||
if (await notValidGuildId({ interaction, executionId })) {
|
||||
return Promise.resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
let shardGuilds: Guild[] = [];
|
||||
|
||||
@@ -29,7 +29,7 @@ const command: CustomSlashCommandInteraction = {
|
||||
});
|
||||
|
||||
if (await notValidGuildId({ interaction, executionId })) {
|
||||
return Promise.resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
@@ -46,7 +46,7 @@ const command: CustomSlashCommandInteraction = {
|
||||
});
|
||||
|
||||
if (await notValidGuildId({ interaction, executionId })) {
|
||||
return Promise.resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
let shardInfoList: ShardInfo[] = [];
|
||||
|
||||
@@ -32,7 +32,7 @@ const command: CustomSlashCommandInteraction = {
|
||||
});
|
||||
|
||||
if (await notValidGuildId({ interaction, executionId })) {
|
||||
return Promise.resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
// from normal /status command
|
||||
@@ -67,24 +67,18 @@ const command: CustomSlashCommandInteraction = {
|
||||
return player.generateStatistics();
|
||||
})
|
||||
.then((results) => {
|
||||
const queueCountList: number[] = [];
|
||||
const trackCountList: number[] = [];
|
||||
const listenerCountList: number[] = [];
|
||||
results.map((result) => {
|
||||
queueCountList.push(result.queues.length);
|
||||
if (result.queues.length > 0) {
|
||||
result.queues.map((queue) => {
|
||||
trackCountList.push(queue.status.playing ? queue.tracksCount + 1 : queue.tracksCount);
|
||||
listenerCountList.push(queue.listeners);
|
||||
});
|
||||
}
|
||||
activeVoiceConnections += result.queues.length;
|
||||
result.queues.map((queue) => {
|
||||
totalTracks += queue.status.playing ? queue.tracksCount + 1 : queue.tracksCount;
|
||||
totalListeners += queue.listeners;
|
||||
});
|
||||
});
|
||||
|
||||
activeVoiceConnections = queueCountList.reduce((acc, queueAmount) => acc + queueAmount, 0);
|
||||
totalTracks = trackCountList.reduce((acc, trackAmount) => acc + trackAmount, 0);
|
||||
totalListeners = listenerCountList.reduce((acc, listenerAmount) => acc + listenerAmount, 0);
|
||||
|
||||
logger.debug('Successfully fetched player statistics from shards.');
|
||||
})
|
||||
.catch((error) => {
|
||||
logger.error(error, 'Failed to fetch player statistics from shards.');
|
||||
});
|
||||
|
||||
logger.debug('Fetching client values from all shards.');
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import config from 'config';
|
||||
import { NodeResolvable, useQueue } from 'discord-player';
|
||||
import { GuildQueue, useQueue } from 'discord-player';
|
||||
import { EmbedBuilder, GuildMember } from 'discord.js';
|
||||
|
||||
import loggerModule from '../../services/logger';
|
||||
@@ -20,7 +20,7 @@ const component: CustomComponentInteraction = {
|
||||
|
||||
logger.debug(`Received skip confirmation for track id ${referenceId}.`);
|
||||
|
||||
const queue: NodeResolvable = useQueue(interaction.guild!.id)!;
|
||||
const queue: GuildQueue = useQueue(interaction.guild!.id)!;
|
||||
|
||||
if (!queue || (queue.tracks.data.length === 0 && !queue.currentTrack)) {
|
||||
logger.debug('Tried skipping track but there was no queue.');
|
||||
|
||||
@@ -15,7 +15,7 @@ export const postBotStats = async ({ client, executionId }: PostBotStatsParams)
|
||||
|
||||
try {
|
||||
if (client.shard?.ids[0] !== 0) {
|
||||
return Promise.resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
let guildCount = 0;
|
||||
@@ -129,7 +129,7 @@ export const postBotStats = async ({ client, executionId }: PostBotStatsParams)
|
||||
sites.map((site) => {
|
||||
if (!site.enabled) {
|
||||
// return if site is disabled
|
||||
return Promise.resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
const options = {
|
||||
|
||||
@@ -18,7 +18,7 @@ export const startLoadTest = async ({ client, executionId }: StartLoadTestParams
|
||||
|
||||
if (!loadTestOptions.enabled) {
|
||||
logger.debug('Load test is disabled in options, cancelling.');
|
||||
return Promise.resolve();
|
||||
return;
|
||||
}
|
||||
|
||||
const channelIds = loadTestOptions.channelIdsToJoin;
|
||||
|
||||
@@ -65,7 +65,7 @@ export const cannotSendMessageInChannel = async ({ interaction, executionId }: C
|
||||
logger.debug(
|
||||
'Sending ephemeral message in channel about insufficient permissions to send message in channel.'
|
||||
);
|
||||
return await interaction.editReply({
|
||||
await interaction.editReply({
|
||||
embeds: [
|
||||
new EmbedBuilder()
|
||||
.setDescription(
|
||||
@@ -74,8 +74,6 @@ export const cannotSendMessageInChannel = async ({ interaction, executionId }: C
|
||||
.setColor(embedOptions.colors.warning)
|
||||
]
|
||||
});
|
||||
} else {
|
||||
return Promise.resolve();
|
||||
}
|
||||
} catch (error) {
|
||||
if (error instanceof Error) {
|
||||
|
||||
Reference in new issue
Block a user