forked from backmeupplz/voicy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
66 lines (63 loc) · 1.96 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// Load env variables
require('dotenv').config({ path: `${__dirname}/.env` })
// Init
const setupPromises = require('./init/setupPromises')
const setupMongoose = require('./init/setupMongoose')
const { bot, startBot } = require('./init/bot')
// Middlewares
const setupCheckDate = require('./middlewares/checkDate')
const setupTimeReceived = require('./middlewares/timeReceived')
const setupCounter = require('./middlewares/counter')
const setupAttachChat = require('./middlewares/attachChat')
const setupI18N = require('./middlewares/i18n')
// Commands
const setupHelp = require('./commands/help')
const { setupStart } = require('./commands/start')
const setupLanguage = require('./commands/language')
const setupEngine = require('./commands/engine')
const setupLock = require('./commands/lock')
const setupFiles = require('./commands/files')
const setupSilent = require('./commands/silent')
const { setupGoogle, setupCheckingCredentials } = require('./commands/google')
const setupGeeky = require('./commands/geeky')
const setupTimecodes = require('./commands/timecodes')
const setupUrl = require('./commands/url')
const setupAdmin = require('./commands/admin')
const setupPrivacy = require('./commands/privacy')
const setupWitToken = require('./commands/witToken')
// Audio handler
const setupAudioHandler = require('./helpers/handler')
// Callbacks
const setupCallbackHandler = require('./helpers/callback')
// Init
setupPromises()
setupMongoose()
// Middlewares
setupTimeReceived(bot)
setupCheckDate(bot)
setupCounter(bot)
setupAttachChat(bot)
setupI18N(bot)
setupCheckingCredentials(bot)
// Commands
setupHelp(bot)
setupStart(bot)
setupLanguage(bot)
setupEngine(bot)
setupLock(bot)
setupFiles(bot)
setupSilent(bot)
setupGoogle(bot)
setupGeeky(bot)
setupTimecodes(bot)
setupUrl(bot)
setupAdmin(bot)
setupPrivacy(bot)
setupWitToken(bot)
bot.command('validation', (ctx) => ctx.reply('success'))
// Audio handler
setupAudioHandler(bot)
// Callbacks
setupCallbackHandler(bot)
// Let's rock!
startBot()