-
Notifications
You must be signed in to change notification settings - Fork 2
/
routes.js
49 lines (45 loc) · 986 Bytes
/
routes.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
const getNews = require('./actions/getNews');
const getGempa = require('./actions/getGempa');
const getBpi = require('./actions/getBpi');
const getBookOffer = require('./actions/getBookOffer');
const getKurs = require('./actions/getKurs');
const getRules = require('./actions/getRules');
const hears = [
{
prefix: /gempa/,
action: getGempa,
},
{
prefix: /(bpi|bitcoin)/i,
suffix: /((hari ini)|(dino iki))/i,
action: getBpi,
},
];
const commands = [
{
command: 'bookoffer',
action: getBookOffer,
},
{
command: 'kurs',
action: getKurs,
},
{
command: 'news',
action: getNews,
},
{
command: 'rules',
action: getRules,
}
];
const events = [
{
event: 'new_chat_members',
action: context => {
const username = context.update.message.from.username;
context.reply(`selamat datang @${username} silahkan perkenalkan diri kak`);
},
},
];
module.exports = [...hears, ...commands, ...events];