forked from MELLIFERA-Labs/kyvechecker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
41 lines (37 loc) · 1.11 KB
/
index.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
const commander = require('commander')
const configManager = require('./src/config-manager')
const log = require('./src/logger')
const program = new commander.Command().option(
'-c, --config <path_to_config>',
'Set a config file'
)
program
.command('bot')
.description('Run a bot')
.action(() => {
configManager.init(program.opts().config)
log.Logger('BOT').info('BOT starting...')
require('./src/bot-start')
})
program
.command('notifier')
.description('Run a notifier')
.action(() => {
configManager.init(program.opts().config)
log.Logger('BOT').info('Notifier starting...')
require('./src/notifier')
})
program
.command('message')
.description('Send message to users')
.argument(
'<message_name>',
'name of message located in messages folder, until ":" sign'
)
.action(async (messageName) => {
configManager.init(program.opts().config)
log.Logger('BOT').info('START message...')
const execute = require('./src/message')
await execute(messageName)
})
program.parse()