Large swathes of re-engineering

This commit is contained in:
2025-11-12 20:41:13 -05:00
parent 6f868dff1e
commit 34f57b96dc
20 changed files with 1567 additions and 196 deletions

View File

@@ -0,0 +1,20 @@
import { Guild, VoiceBasedChannel } from "discord.js";
import { SQLCommon } from "../storage/interfaces";
export async function breadbotInCall(db: SQLCommon, channel: VoiceBasedChannel) : Promise<boolean> {
const queryResult: Object[] = await db.getAllParameterized(
"SELECT * FROM calls WHERE channel_snowflake = ? AND call_end_time IS NULL",
[channel.id]
)
return queryResult.length != 0
}
export async function getExistingCallID(db: SQLCommon, channel: VoiceBasedChannel) : Promise<Number> {
const queryResult: any[] = await db.getAllParameterized(
"SELECT * FROM calls WHERE channel_snowflake = ? AND call_end_time IS NULL",
[channel.id]
)
return queryResult.length != 0 ? queryResult[0].call_id : -1
}