-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbot.js
More file actions
28 lines (24 loc) · 730 Bytes
/
Copy pathbot.js
File metadata and controls
28 lines (24 loc) · 730 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
import { handleAcknowledgement } from './acknowledgeHandler'
import Botkit from 'botkit'
require('dotenv').config();
const reactionIcon = (bot, message) => {
bot.api.reactions.add({
timestamp: message.ts,
channel: message.channel,
name: 'robot_face',
}, function (err, res) {
if (err) {
bot.botkit.log('Failed to add emoji reaction :(', err);
}
});
};
let controller = Botkit.slackbot({
debug: true,
});
let bot = controller.spawn({
token: process.env.API_TOKEN
}).startRTM();
controller.hears('acknowledge', ['direct_message', 'direct_mention', 'mention'], (bot, message) => {
reactionIcon(bot, message);
handleAcknowledgement(bot, message)
});