[READ-ONLY] Mirror of https://github.com/maybeanerd/MagiBot. MagiBot - the community building discord bot that adds joinsounds to your voice channels! discord.gg/2Evcf4T
bot bots community discord gaming hacktoberfest sound
1

Configure Feed

Select the types of activity you want to include in your feed.

fix: use correct query to get queues from DB, adjust fallback to not delete queues if message or channel cant be found on normal interaction

Sebastian Di Luzio (Jun 1, 2023, 9:19 PM +0200) 105a9018 2986756b

+7 -9
+6 -8
src/commands/queue/index.ts
··· 186 186 if (wentToNextUser) { 187 187 const channel = await guild.channels.fetch(wentToNextUser.channelId); 188 188 if (!channel) { 189 - // We should only get here if we cannot access the channel anymore 190 - // and therefore we should end the queue 191 - await endRunningQueue(interaction); 192 - return; 189 + throw new Error( 190 + `Failed to get channel of queue message. GuildId: ${guild.id}; ChannelId: ${wentToNextUser.channelId}`, 191 + ); 193 192 } 194 193 195 194 const topicMessage = await (channel as TextChannel).messages.fetch( 196 195 wentToNextUser.messageId, 197 196 ); 198 197 if (!topicMessage) { 199 - // We should only get here if we cannot find the original message anymore 200 - // and therefore we should end the queue 201 - await endRunningQueue(interaction); 202 - return; 198 + throw new Error( 199 + `Failed to get queue message. GuildId: ${guild.id}; ChannelId: ${wentToNextUser.channelId}; MessageId: ${wentToNextUser.messageId}`, 200 + ); 203 201 } 204 202 205 203 messageEdit(
+1 -1
src/commands/queue/stateManager.ts
··· 1 1 import { OngoingQueue, OngoingQueueModel } from '../../db'; 2 2 3 3 async function getQueue(guildId: string) { 4 - return OngoingQueueModel.findOne({ where: { guildId } }); 4 + return OngoingQueueModel.findOne({ guildId }); 5 5 } 6 6 7 7 function getActiveUserOfQueue(queue: OngoingQueue) {