Coder Social home page Coder Social logo

michaeljymsgutierrez / git-messenger-webhook Goto Github PK

View Code? Open in Web Editor NEW
6.0 3.0 1.0 300 KB

A simple git webhook event notification for facebook messenger.

License: MIT License

JavaScript 100.00%
git facebook nodejs bash facebook-chat-api webhook fastify shelljs pm2 facebook-messenger

git-messenger-webhook's Introduction

Git Messenger Webhook gitmessengerchatbot

A simple git webhook event notification for facebook messenger.

  • Github Webhook
  • Gitlab Webhook
  • Bitbucket Webhook
  1. clone this repo and do npm install

  2. install pm2 package npm install pm2 -g

  3. create .env file and type disable otp password in facebook login

  EMAIL: "[email protected]" //fb email
  PASSWORD: "facebookpassword"     //fb password
  TITLE: Chatbot Name              //chatbot name
  WEBHOOK_PORT="3005"              //preferred port
  1. Start pm2 process and then save pm2 start webhook.js --name webhook-name & pm2 save

  1. Go to webhook Settings->Integrations->URL

http://yourserverip:port/integrate/webhook/messengerGroupChatID

  • Group Chat ID shown on the parameter of messenger.com when you select the specific groupchat.

sample http://182.232.34.23:3005/integrate/webhook/1818601588228287 or http://gitmessengerchatbot.com:3005/integrate/webhook/1818601588228287

  1. Try it yourself ๐Ÿ˜ƒ

git-messenger-webhook's People

Contributors

mharrvic avatar michaeljymsgutierrez avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

mharrvic

git-messenger-webhook's Issues

Moved .env.sample to env.js

Instead of using dotenv module and .env file from .env.sample.
Implement env.sample.js as default environment file which will use env.js.

For further clarification, comment down

Username and password login not working with facebook-chat-api

Using just credentials with the facebook-chat-api seem to have stopped working at some point, throwing the following error into the PM2 error-logs

- info login Logging in...
- ERR! login Wrong username/password.
- { error: 'Wrong username/password.' }

login(
{
email: process.env.EMAIL,
password: process.env.PASSWORD,
},

A workaround is exporting the cookies when logged in(only the table of the cookie), and reading that

const fs = require('fs');
const credentials = { appState : JSON.parse(fs.readFileSync('appstate.json', 'utf8')) };

(In the above example, appstate.json containing)

[{"domain":".facebook.com","expirationDate":...

and passing that to login

login(credentials,
      (err, api) =>

facebook-chat-api seem to have been deprecated, with a new API existing for chatbots by facebook, would be cool if this supported that instead, or at least updated to work with the suggested workaround.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.