diff --git a/src/commands/queue/index.ts b/src/commands/queue/index.ts index 4b7bc4ba..b5bbb90e 100644 --- a/src/commands/queue/index.ts +++ b/src/commands/queue/index.ts @@ -186,20 +186,18 @@ export async function goToNextUser( if (wentToNextUser) { const channel = await guild.channels.fetch(wentToNextUser.channelId); if (!channel) { - // We should only get here if we cannot access the channel anymore - // and therefore we should end the queue - await endRunningQueue(interaction); - return; + throw new Error( + `Failed to get channel of queue message. GuildId: ${guild.id}; ChannelId: ${wentToNextUser.channelId}`, + ); } const topicMessage = await (channel as TextChannel).messages.fetch( wentToNextUser.messageId, ); if (!topicMessage) { - // We should only get here if we cannot find the original message anymore - // and therefore we should end the queue - await endRunningQueue(interaction); - return; + throw new Error( + `Failed to get queue message. GuildId: ${guild.id}; ChannelId: ${wentToNextUser.channelId}; MessageId: ${wentToNextUser.messageId}`, + ); } messageEdit( diff --git a/src/commands/queue/stateManager.ts b/src/commands/queue/stateManager.ts index 5d2a2a6c..b411c475 100644 --- a/src/commands/queue/stateManager.ts +++ b/src/commands/queue/stateManager.ts @@ -1,7 +1,7 @@ import { OngoingQueue, OngoingQueueModel } from '../../db'; async function getQueue(guildId: string) { - return OngoingQueueModel.findOne({ where: { guildId } }); + return OngoingQueueModel.findOne({ guildId }); } function getActiveUserOfQueue(queue: OngoingQueue) {