src/db/models/Guild.js
// add the guild from message in the database 'Guild'. Also set prefix to config.prefix
add the guild from message in the database 'Guild'. Also set prefix to config.prefix
add the guild from message in the database ' Guild ' . Also set prefix to config . prefix
async function add(client, guild_id) {
    client.logger.log("info", `try to add guild ${guild_id} to database 'Guild'`)
    try {
        await client.DB.Guild.TABLE.create({
            guild_id: guild_id,
            prefix: client.config.prefix,
            mensa_channel_id: null,
            mensa_enabled: false,
            bday_channel_id: null,
            bday_enabled: false
        })
        client.logger.log("info",`guild ${guild_id} successfully added to database 'Guild'`)
    } catch (e) {
        if (e.name === 'SequelizeUniqueConstraintError') {
            client.logger.log("warn",`guild ${guild_id} already exist in database 'Guild'`)
        } else {
            client.logger.log("error",`Something went wrong with adding guild ${guild_id} in database 'Guild'`)
        }
    }
}
async function add ( client , guild_id ) { client . logger . log ( "info" , ` ${ guild_id } ` ) try { await client . DB . Guild . TABLE . create ( { guild_id : guild_id , prefix : client . config . prefix , mensa_channel_id : null , mensa_enabled : false , bday_channel_id : null , bday_enabled : false } ) client . logger . log ( "info" , ` ${ guild_id } ` ) } catch ( e ) { if ( e . name === 'SequelizeUniqueConstraintError' ) { client . logger . log ( "warn" , ` ${ guild_id } ` ) } else { client . logger . log ( "error" , ` ${ guild_id } ` ) } } }
add the guild from message in the database 'Guild'.
add the guild from message in the database ' Guild ' .