This repository was archived by the owner on Sep 18, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +42
-0
lines changed
Expand file tree Collapse file tree 3 files changed +42
-0
lines changed Original file line number Diff line number Diff line change 1+ node_modules
Original file line number Diff line number Diff line change 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 ) ;
Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments