From 81f91df8ac9482cfc705cec917d9d6d1ad1116dd Mon Sep 17 00:00:00 2001 From: Bradley Bickford Date: Mon, 8 Jan 2024 06:47:22 -0500 Subject: [PATCH] Adding a fix for when new calls are starting in voice channels that haven't been registered yet --- breadbot.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/breadbot.js b/breadbot.js index bee8d7c..72035c7 100644 --- a/breadbot.js +++ b/breadbot.js @@ -109,6 +109,9 @@ client.on(Events.VoiceStateUpdate, async (oldState, newState) => { logger.info(`Channel Join Detected ${newState.guild.id} - ${newState.channelId} - ${newState.member.id}`) + //TODO Nothing should happen after this if the channel fails to register + await sqlutil.registerChannelIfMissing(newState.channel.id, newState.guild.id, newState.channel.name) + var existingCallID = await sqlutil.inCall(newState.guild.id, newState.channelId) logger.info(`Existing call ID ${existingCallID}`)