-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
39 lines (33 loc) · 1.19 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
/*
CONGRATULATIONS on creating your first Botpress bot!
This is the programmatic entry point of your bot.
Your bot's logic resides here.
Here's the next steps for you:
1. Read this file to understand how this simple bot works
2. Read the `content.yml` file to understand how messages are sent
3. Install a connector module (Facebook Messenger and/or Slack)
4. Customize your bot!
Happy bot building!
The Botpress Team
----
Getting Started (Youtube Video): https://www.youtube.com/watch?v=HTpUmDz9kRY
Documentation: https://botpress.io/docs
Our Slack Community: https://slack.botpress.io
*/
module.exports = function(bp) {
// Listens for a first message (this is a Regex)
// GET_STARTED is the first message you get on Facebook Messenger
bp.hear(/GET_STARTED|hello|hi|test|hey|holla/i, (event, next) => {
event.reply('#welcome') // See the file `content.yml` to see the block
})
// You can also pass a matcher object to better filter events
bp.hear({
type: /message|text/i,
text: /exit|bye|goodbye|quit|done|leave|stop/i
}, (event, next) => {
event.reply('#goodbye', {
// You can pass data to the UMM bloc!
reason: 'unknown'
})
})
}