Skip to content

dstdfx/twbridge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

92 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

twbridge

This repository contains an implementation of Telegram <-> Whatsapp bridge.
It allows you to receive incoming Whatsapp messages in Telegram chat and reply to them.

How it works

All text messages that you receive in Whatsapp chats are being forwarded to Telegram chat with the bot.
Incoming text messages have the following format:

From: Test User [jid: testuser@gmail.com]
= = = = = = = = = = = =
Message: hello, world!

Reply to a message can be done by simply replying to a specific message.

Requirements

To run this app you need a Telegram bot created, check this manual if you've never done it before.
Once you managed to create it you'll have an API token which will be used to run this app.

Build

Use the following command to build a binary:

make build

Use the following command to build a Docker image:

docker build -t twbridge .

Running

Run locally:

export TELEGRAM_API_TOKEN=<your-telegram-bot-token>; ./twbridge

Run in docker:

docker run -d --env TELEGRAM_API_TOKEN="<YOUR-TELEGRAM_API_TOKEN>" ghcr.io/dstdfx/twbridge:latest

Testing

Use the following command to run unit-tests and linters:

make tests

Use the following command to run unit-tests only:

make unittests

Use the following command to run golangci-lint:

make golangci-lint