diff --git a/breadbot.js b/breadbot.js index 4da7cc9..4d086c0 100644 --- a/breadbot.js +++ b/breadbot.js @@ -104,8 +104,8 @@ client.on(Events.VoiceStateUpdate, async (oldState, newState) => { fs.mkdirSync("." + path.sep + "media" + path.sep + "voice_audio" + path.sep + newCallID, {recursive: true}) const voiceChannel = newState.guild.channels.cache - .filter(c => c.type == "voice" || c.type == "stage") - .find(c => c.id == newState.channelId) + .filter(c => c.type === "voice" || c.type === "stage") + .find(c => c.id === newState.channelId) if(!voiceChannel) { console.log("VOICE CHANNEL LOOKUP FAILED") diff --git a/utilities/sqlutil.js b/utilities/sqlutil.js index 8ce7739..1298ffb 100644 --- a/utilities/sqlutil.js +++ b/utilities/sqlutil.js @@ -145,8 +145,6 @@ async function getVoiceActiveUsers(server_snowflake, channel_snowflake) { async function inCall(server_snowflake, channel_snowflake) { return connection_pool.query("SELECT call_id FROM call_states WHERE server_snowflake = ? AND channel_snowflake = ? AND call_end_time IS NULL", [server_snowflake, channel_snowflake]).then(async ([rows, fields]) => { - console.log(`Num rows: ${rows.length}`) - console.log(rows) if (rows.length == 0) { return -1; } else { @@ -163,6 +161,7 @@ async function inCall(server_snowflake, channel_snowflake) { async function registerNewCall(server_snowflake, channel_snowflake, call_start_time) { return connection_pool.query("INSERT INTO call_states (server_snowflake, channel_snowflake, call_start_time, call_end_time, call_consolidated, call_transcribed, call_data_cleaned_up) VALUES (?, ?, ?, NULL, 0, 0, 0)", [server_snowflake, channel_snowflake, call_start_time]).then(async ([rows, fields]) => { + print(`Register New Call: ${rows}`) if (rows.length == 0) { return -1; } else {