Skip to content
This repository was archived by the owner on Sep 18, 2024. It is now read-only.

Commit ef7177d

Browse files
committed
initial setup
1 parent 4cde098 commit ef7177d

File tree

3 files changed

+42
-0
lines changed

3 files changed

+42
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

app.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
const http = require('http')
2+
const Bot = require('messenger-bot')
3+
4+
let bot = new Bot({
5+
token: process.env.PAGE_TOKEN,
6+
verify: process.env.VERIFY_TOKEN,
7+
});
8+
9+
bot.on('error', (err) => {
10+
console.log(err.message)
11+
});
12+
13+
bot.on('message', (payload, reply) => {
14+
let text = payload.message.text;
15+
console.log(text);
16+
});
17+
18+
let port = process.env.PORT || 3000;
19+
http.createServer(bot.middleware()).listen(port);

package.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"name": "ntw-hello-bot",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "app.js",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1"
8+
},
9+
"repository": {
10+
"type": "git",
11+
"url": "git+https://github.com/devc-nairobi/ntw-hello-bot.git"
12+
},
13+
"author": "",
14+
"license": "ISC",
15+
"bugs": {
16+
"url": "https://github.com/devc-nairobi/ntw-hello-bot/issues"
17+
},
18+
"homepage": "https://github.com/devc-nairobi/ntw-hello-bot#readme",
19+
"dependencies": {
20+
"messenger-bot": "^2.4.0"
21+
}
22+
}

0 commit comments

Comments
 (0)