lyfe1 / index.js
Ayanokojix23's picture
hello world
bb69f9b
raw
history blame contribute delete
592 Bytes
const { Client, logger } = require('./lib/client')
const { DATABASE, VERSION } = require('./config')
const { stopInstance } = require('./lib/pm2')
const start = async () => {
logger.info(`levanter ${VERSION}`)
try {
await DATABASE.authenticate({ retry: { max: 3 } })
} catch (error) {
const databaseUrl = process.env.DATABASE_URL
logger.error({ msg: 'Unable to connect to the database', error: error.message, databaseUrl })
return stopInstance()
}
try {
const bot = new Client()
await bot.connect()
} catch (error) {
logger.error(error)
}
}
start()