-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcommands.js
More file actions
30 lines (27 loc) · 754 Bytes
/
commands.js
File metadata and controls
30 lines (27 loc) · 754 Bytes
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
const gif = require('./gif.js');
const weather = require('./weather.js');
const bandi = require('./bandi.js');
const catfact = require('./catfact.js');
const Promise = require('bluebird');
const noCommand = function (message) {
return Promise.resolve({
text: 'Sorry, I don\'t know: ' + message.command.command,
to: message.numbers.to,
from: message.numbers.from
});
};
const commandError = function (message) {
return Promise.resolve({
text: 'Sorry, something went wrong',
to: message.numbers.to,
from: message.numbers.from
});
}
module.exports = {
gif: gif.handleGifCommand,
weather: weather.handleWeatherCommand,
error: commandError,
default: noCommand,
bandi: bandi.handleBandiCommand,
catfact: catfact.handleCatFactCommand
}