Repository navigation
Expand file tree
/
Copy pathBot.js
More file actions
63 lines (37 loc) · 1.46 KB
/
Copy pathBot.js
File metadata and controls
63 lines (37 loc) · 1.46 KB
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
const Zazoo = require('./Lib/Zazoo/Bot/Zazoo.js').Zazoo
const fs = require('fs');
const Bot = new Zazoo({
accessToken: '',
verifyToken: '', // choose what ever you want
appSecret: '', // app secret from facebook developer
Url: "" // Domain That the bot running on him
})
Bot.on('message',(payload, chat) => { // Every Time That the bot get any message he print her
const text = payload.sender.id; // take the text from the request
console.log("User Said: " + text) // print the text
});
Bot.hear(['Menu'], (payload,chat) => {
if(new new require('./Lib/Zazoo/KnownUsers/KnownUsers.js').KnownUsers().Known(payload.sender.id)) // Chack if that is new user that chatting with as
{
Bot.SendMenu(payload.sender.id) // Send the menu to the user that asked for.
}
else
{
// The user That ask for the menu is not register user.
// send him to get started.
chat.say({
text:'Plz Go To "Get Started" before you start to use.',
quickReplies: ['Get Started']
});
}
});
function StartAlerts()
{
require('./Lib/Zazoo/Alerts/AlertsBirds.js').StartBirdAlerts(Bot)
}
setInterval(StartAlerts,1200000)
require('./Lib/Zazoo/Menu/MenuRespones.js').MenuRespones(Bot); // Bot starting hear to menu command.
Bot.PremiumWebSite() // starting bot website.
Bot.StartMapService() // Starting map service
Bot.start(3000) // The Bot starting command.
module.exports.Bot = Bot;