mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-04 06:28:53 +00:00
fix: Ensure promise is returned where applicable
This commit is contained in:
1 parent
f231c53fe8
commit
14cb6b4936
23 files changed
+86
-125
No files matched your search
@@ -40,21 +40,21 @@ const command: CustomSlashCommandInteraction = {
|
||||
});
|
||||
|
||||
if (await notInVoiceChannel({ interaction, executionId })) {
|
||||
return;
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
const queue: NodeResolvable = useQueue(interaction.guild!.id)!;
|
||||
|
||||
if (await queueDoesNotExist({ interaction, queue, executionId })) {
|
||||
return;
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
if (await notInSameVoiceChannel({ interaction, queue, executionId })) {
|
||||
return;
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
if (await queueNoCurrentTrack({ interaction, queue, executionId })) {
|
||||
return;
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
const filterOptions: StringSelectMenuOptionBuilder[] = [];
|
||||
|
||||
@@ -28,7 +28,7 @@ const command: CustomSlashCommandInteraction = {
|
||||
});
|
||||
|
||||
if (await notInVoiceChannel({ interaction, executionId })) {
|
||||
return;
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
const queue: NodeResolvable = useQueue(interaction.guild!.id)!;
|
||||
@@ -49,7 +49,7 @@ const command: CustomSlashCommandInteraction = {
|
||||
}
|
||||
|
||||
if (await notInSameVoiceChannel({ interaction, queue, executionId })) {
|
||||
return;
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
if (!queue.deleted) {
|
||||
|
||||
@@ -42,17 +42,17 @@ const command: CustomSlashCommandInteraction = {
|
||||
});
|
||||
|
||||
if (await notInVoiceChannel({ interaction, executionId })) {
|
||||
return;
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
const queue: NodeResolvable = useQueue(interaction.guild!.id)!;
|
||||
|
||||
if (await queueDoesNotExist({ interaction, queue, executionId })) {
|
||||
return;
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
if (await notInSameVoiceChannel({ interaction, queue, executionId })) {
|
||||
return;
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
const loopModesFormatted = new Map([
|
||||
|
||||
@@ -48,19 +48,19 @@ const command: CustomSlashCommandInteraction = {
|
||||
|
||||
if (!query) {
|
||||
if (await notInVoiceChannel({ interaction, executionId })) {
|
||||
return;
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
if (await queueDoesNotExist({ interaction, queue, executionId })) {
|
||||
return;
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
if (await notInSameVoiceChannel({ interaction, queue, executionId })) {
|
||||
return;
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
if (await queueNoCurrentTrack({ interaction, queue, executionId })) {
|
||||
return;
|
||||
return Promise.resolve();
|
||||
}
|
||||
geniusSearchQuery = queue.currentTrack!.title.slice(0, 50);
|
||||
|
||||
@@ -188,7 +188,7 @@ const command: CustomSlashCommandInteraction = {
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
logger.debug('Responding with info embed.');
|
||||
|
||||
@@ -38,21 +38,21 @@ const command: CustomSlashCommandInteraction = {
|
||||
});
|
||||
|
||||
if (await notInVoiceChannel({ interaction, executionId })) {
|
||||
return;
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
const queue: NodeResolvable = useQueue(interaction.guild!.id)!;
|
||||
|
||||
if (await queueDoesNotExist({ interaction, queue, executionId })) {
|
||||
return;
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
if (await notInSameVoiceChannel({ interaction, queue, executionId })) {
|
||||
return;
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
if (await queueNoCurrentTrack({ interaction, queue, executionId })) {
|
||||
return;
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
const sourceStringsFormatted = new Map([
|
||||
|
||||
@@ -29,21 +29,21 @@ const command: CustomSlashCommandInteraction = {
|
||||
});
|
||||
|
||||
if (await notInVoiceChannel({ interaction, executionId })) {
|
||||
return;
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
const queue: NodeResolvable = useQueue(interaction.guild!.id)!;
|
||||
|
||||
if (await queueDoesNotExist({ interaction, queue, executionId })) {
|
||||
return;
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
if (await notInSameVoiceChannel({ interaction, queue, executionId })) {
|
||||
return;
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
if (await queueNoCurrentTrack({ interaction, queue, executionId })) {
|
||||
return;
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
const currentTrack = queue.currentTrack!;
|
||||
|
||||
@@ -44,16 +44,16 @@ const command: CustomSlashCommandInteraction = {
|
||||
});
|
||||
|
||||
if (await notInVoiceChannel({ interaction, executionId })) {
|
||||
return;
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
if (await cannotJoinVoiceOrTalk({ interaction, executionId })) {
|
||||
return;
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
let queue = useQueue(interaction.guild!.id);
|
||||
if (queue && (await notInSameVoiceChannel({ interaction, queue, executionId }))) {
|
||||
return;
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
const player = useMainPlayer()!;
|
||||
|
||||
@@ -30,13 +30,13 @@ const command: CustomSlashCommandInteraction = {
|
||||
});
|
||||
|
||||
if (await notInVoiceChannel({ interaction, executionId })) {
|
||||
return;
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
const queue: NodeResolvable = useQueue(interaction.guild!.id)!;
|
||||
|
||||
if (await notInSameVoiceChannel({ interaction, queue, executionId })) {
|
||||
return;
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
const pageIndex = (interaction.options.getNumber('page') || 1) - 1;
|
||||
|
||||
@@ -36,17 +36,17 @@ const command: CustomSlashCommandInteraction = {
|
||||
});
|
||||
|
||||
if (await notInVoiceChannel({ interaction, executionId })) {
|
||||
return;
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
const queue: NodeResolvable = useQueue(interaction.guild!.id)!;
|
||||
|
||||
if (await queueDoesNotExist({ interaction, queue, executionId })) {
|
||||
return;
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
if (await notInSameVoiceChannel({ interaction, queue, executionId })) {
|
||||
return;
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
const removeTrackNumber = interaction.options.getNumber('tracknumber')!;
|
||||
|
||||
@@ -35,21 +35,21 @@ const command: CustomSlashCommandInteraction = {
|
||||
});
|
||||
|
||||
if (await notInVoiceChannel({ interaction, executionId })) {
|
||||
return;
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
const queue: NodeResolvable = useQueue(interaction.guild!.id)!;
|
||||
|
||||
if (await queueDoesNotExist({ interaction, queue, executionId })) {
|
||||
return;
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
if (await notInSameVoiceChannel({ interaction, queue, executionId })) {
|
||||
return;
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
if (await queueNoCurrentTrack({ interaction, queue, executionId })) {
|
||||
return;
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
const durationInput = interaction.options.getString('duration');
|
||||
|
||||
@@ -29,21 +29,21 @@ const command: CustomSlashCommandInteraction = {
|
||||
});
|
||||
|
||||
if (await notInVoiceChannel({ interaction, executionId })) {
|
||||
return;
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
const queue: NodeResolvable = useQueue(interaction.guild!.id)!;
|
||||
|
||||
if (await queueDoesNotExist({ interaction, queue, executionId })) {
|
||||
return;
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
if (await notInSameVoiceChannel({ interaction, queue, executionId })) {
|
||||
return;
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
if (await queueIsEmpty({ interaction, queue, executionId })) {
|
||||
return;
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
queue.tracks.shuffle();
|
||||
|
||||
@@ -32,21 +32,21 @@ const command: CustomSlashCommandInteraction = {
|
||||
});
|
||||
|
||||
if (await notInVoiceChannel({ interaction, executionId })) {
|
||||
return;
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
const queue: NodeResolvable = useQueue(interaction.guild!.id)!;
|
||||
|
||||
if (await queueDoesNotExist({ interaction, queue, executionId })) {
|
||||
return;
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
if (await notInSameVoiceChannel({ interaction, queue, executionId })) {
|
||||
return;
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
if (await queueNoCurrentTrack({ interaction, queue, executionId })) {
|
||||
return;
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
const skipToTrack = interaction.options.getNumber('tracknumber');
|
||||
|
||||
@@ -28,7 +28,7 @@ const command: CustomSlashCommandInteraction = {
|
||||
});
|
||||
|
||||
if (await notInVoiceChannel({ interaction, executionId })) {
|
||||
return;
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
const queue: NodeResolvable = useQueue(interaction.guild!.id)!;
|
||||
@@ -49,7 +49,7 @@ const command: CustomSlashCommandInteraction = {
|
||||
}
|
||||
|
||||
if (await notInSameVoiceChannel({ interaction, queue, executionId })) {
|
||||
return;
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
if (!queue.deleted) {
|
||||
|
||||
@@ -36,17 +36,17 @@ const command: CustomSlashCommandInteraction = {
|
||||
});
|
||||
|
||||
if (await notInVoiceChannel({ interaction, executionId })) {
|
||||
return;
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
const queue: NodeResolvable = useQueue(interaction.guild!.id)!;
|
||||
|
||||
if (await queueDoesNotExist({ interaction, queue, executionId })) {
|
||||
return;
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
if (await notInSameVoiceChannel({ interaction, queue, executionId })) {
|
||||
return;
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
const volume = interaction.options.getNumber('percentage');
|
||||
|
||||
Reference in new issue
Block a user