This repository has been archived by the owner on Jul 31, 2023. It is now read-only.
forked from clanbeat/lunchbot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
65 lines (53 loc) · 1.65 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// index.js
var LunchBot = require('./lib/lunchbot');
var FacebookSource = require('./lib/sources/facebook');
var Parsers = require('./lib/parsers');
var Filters = require('./lib/filters');
var config = require('config');
var Promise = require('bluebird');
var token = config.get('slack.api');
var name = config.get('slack.name');
process.on('uncaughtException', function(err) {
console.log(err);
});
process.on('exit', function() {
console.log('Process exiting');
});
var bot = new LunchBot({
token: token,
name: name,
usesReactionVoting: config.get('slack.usesReactionVoting')
});
var params = {
chains: [
{
parser: Parsers.weeklyMenu,
filter: Filters.startOfWeek
},
{
parser: Parsers.basicPrice,
filter: Filters.sameDay
}
]
};
var imageParams = {
chains: [
{
parser: Parsers.imageOnly,
filter: Filters.sameDay
}
]
};
//
// Sources
//
const sesoon = new FacebookSource('fork_and_knife', 'Sesoon', 'KohvikSesoon', params);
const apelsin = new FacebookSource('tangerine', 'Apelsini Raudtee', 'apelsiniraudtee', params);
const truhvel = new FacebookSource('coffee', 'Trühvel', '1829502837275034', params);
//const korsten = new FacebookSource('tokyo_tower', 'Korsten', 'Korstenresto', params);
const uulits = new FacebookSource('hamburger', 'Uulits', 'uulitsrestoran', params);
const lendav = new FacebookSource('satellite_antenna', 'Lendav Taldrik', '389723857828746', imageParams);
const services = [sesoon, apelsin, truhvel, uulits, lendav];
console.log('Starting LunchBot with ' + services.length + ' services');
bot.services = services;
bot.run();