Code Monkey home page Code Monkey logo

whatsapp-telegram-bridge's Introduction

Whatsapp Telegram Bridge

This project creates a bridge between a whatsapp chat and a telegram channel, ie you could recieve the messages sent on whatsapp through telegram.

How to use

It is recommended that you use Node and NPM locally and use Docker if you wanna deploy, as the container is very large.

  1. Create a settings.json file from the settings.example.json. In the PIPES key store your all your required whatsapp chat's names.

  2. Create a telegram bot. Find the API key, and store it as value of key TOKEN.

  3. If you want to use it for a private channel, follow this link, and obatin chat_id

    If you don't mind creating a public channel, create it and obtain chat_id(@your channel name in url)

  4. Add chat_id to your corresponding whatsapp chat's key.

  5. Run

    npm install
    npm start
    
  6. It will display a QR code for whatsapp authentication, scan the QR code using whatsapp. You won't have to do this again.

Deploy

  1. Run the script and login locally.(This is important as we need that session data)

  2. Deploy the docker container with a cloud service(Heroku is free).

  3. Set TOKEN environment variable with your BOT_API_KEY

  4. Set PIPES environment variable as a JSON String of your Whatsapp-Telegram Pipes.

All Settings

Settings can be stored in a json file or as environment variables.

TOKEN

The BOT_API_TOKEN obtained while creating your telegram bot.

PIPES

The mappings between whatsapp chats and telegram channel. Must be stored as JSON. Can have multiple pipes.

SHOW_DEFAULT_HEADER

Show or hide default header.

Sent from whatsapp chat: $chat_name

Sent by: $sender

Currently headers don't work for attachments.

Default is true

CUSTOM_HEADER

Add your own header to all messages sent except attachments.

Note: Passing a CUSTOM_HEADER won't disable DEFAULT_HEADER, you have to explicitly set it to false.

Limitations

  • Since WhatsApp has no official API, the API used is based on WhatsApp Web. So you can't use WhatsApp Web while running this.

  • WhatsApp Web relies on your phone's internet too, so even if you deploy this on a server, your phone must have 24x7 internet access too.

Acknowledgements

Whatsapp API - Venom

Telegram Bot API - node-telegram-bot-api

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.