57 lines
986 B
JavaScript
57 lines
986 B
JavaScript
const { readdirSync } = require('fs')
|
||
const path = require('path')
|
||
const ms = require('ms')
|
||
const oS = require('os')
|
||
const cS = require('chalk')
|
||
|
||
const config = {}
|
||
|
||
config.isDev = process.env.NODE_ENV === 'development'
|
||
|
||
config.consignOpts = {
|
||
cwd: process.cwd() + '/src',
|
||
extensions: ['.js'],
|
||
verbose: false
|
||
}
|
||
|
||
config.limitSecurity = {
|
||
window: ms('15s'),
|
||
limit: 8,
|
||
onLimitExceeded: ({ replyWithHTML }) =>
|
||
replyWithHTML('<code>❗️Please wait a second (5s)</code>', {
|
||
disable_notification: true
|
||
})
|
||
}
|
||
|
||
config.i18nOpts = {
|
||
directory: path.resolve(__dirname, '../locales'),
|
||
defaultLanguage: 'en',
|
||
defaultLanguageOnMissing: true
|
||
}
|
||
|
||
config.settings = {
|
||
setCommand: ({ setMyCommands }, next) => {
|
||
return next().then(() => {
|
||
setMyCommands([
|
||
{
|
||
command: 'start',
|
||
description: 'Start bot or restart'
|
||
},
|
||
{
|
||
command: 'lang',
|
||
description: 'Change language'
|
||
}
|
||
])
|
||
})
|
||
}
|
||
}
|
||
|
||
module.exports = {
|
||
config,
|
||
readdirSync,
|
||
path,
|
||
ms,
|
||
oS,
|
||
cS
|
||
}
|