Utils/utility_functions.js
/**
 * Checks if users can create one time alarms, pass undefined for private alarms
 * @param {String} user_id - the id of the users
 * @param {String} guild_id - the id of the guild
 */
Checks if users can create one time alarms, pass undefined for private alarms
@param {String} user_id - the id of the users
@param {String} guild_id - the id of the guild
Checks if users can create one time alarms pass undefined for private alarms @param { String } user_id - the id of the users @param { String } guild_id - the id of the guild
async function can_create_ota_alarm(user_id, guild_id) {
    let alarmsUser = await alarm_db.get_all_otas_from_user(user_id);
    if (await (isPremiumUser(user_id))) {
        return alarmsUser.length < auth.max_alarms_VIP;
    }
    let alarmsGuild = guild_id !== undefined ? (await alarm_db.get_all_otas_from_guild(guild_id))?.length : 0;
    return alarmsUser.length < auth.max_alarms_user
        && alarmsGuild < auth.max_alarms_server;
}
async function can_create_ota_alarm ( user_id , guild_id ) { let alarmsUser = await alarm_db . get_all_otas_from_user ( user_id ) ; if ( await ( isPremiumUser ( user_id ) ) ) { return alarmsUser . length < auth . max_alarms_VIP ; } let alarmsGuild = guild_id !== undefined ? ( await alarm_db . get_all_otas_from_guild ( guild_id ) ) ?. length : 0 ; return alarmsUser . length < auth . max_alarms_user && alarmsGuild < auth . max_alarms_server ; }
Checks if users can create one time alarms, pass undefined for private alarms
 @param {String} user_id - the id of the users
 @param {String} guild_id - the id of the guild
Checks if users can create one time alarms pass undefined for private alarms @param { String } user_id - the id of the users @param { String } guild_id - the id of the guild