The goal of this app is to send/map received messages in one chat to another chat applying filters and mutations to them.
See here how it works, with examples
Currently, there are 2 ways to run this program.
Steps below are required for both options
- Copy
.env.examplewith name.envand fill your telegram credentials.TELEGRAM_API_ID,TELEGRAM_API_HASHandTELEGRAM_PHONEare required.Take creds from https://my.telegram.org/apps
- Create
jsonconfiguration file. (examples:config/answer_machine.json.example,config/echo.json)
-
Build image
docker build -t anwsonwsymous/telemap:slim .On
arm64architecture use--platformoption to emulateamd64docker build --platform linux/amd64 -t anwsonwsymous/telemap:slim . -
Copy
config/echo.json.exampletoconfig/echo.jsonand put your chatid -
Run container and pass newly created
jsonconfig pathdocker run \ --rm \ --init \ --interactive \ --tty \ --memory 25m \ --volume $(pwd)/telegram_database:/app/telegram_database \ --volume $(pwd)/storage:/app/storage \ --volume $(pwd)/config:/config \ --volume $(pwd)/.env:/app/.env \ --env-file $(pwd)/.env --name telemap-app \ anwsonwsymous/telemap:slim -c /config/echo.json
Build tdjson manually or copy from docker image.
For linking tdjson either use RUSTFLAGS or LD_LIBRARY_PATH environment variable.
Currently, supported version is 18.0.0
Run with cargo
RUSTFLAGS="-C link-args=-Wl,-rpath,/tdjson/path,-L/tdjson/path" cargo run -- -c /app/config/answer_machine.jsonid=$(docker create wcsiu/tdlib:1.8.0)
docker cp $id:/td/build/libtdjson.so.1.8.0 /tdjson/path
docker cp -L $id:/td/build/libtdjson.so /tdjson/path
docker rm -v $idFind more information on pipes and filters in their respective directories:
Pull requests are welcome. Please open an issue first to discuss what you would like to change.
Please make sure to update tests and README as appropriate.
- Run container with project directory
volume - Make code changes
- Run with cargo
# Run container with project directory volume
docker run \
--interactive \
--tty \
--name telemap-dev \
--entrypoint /bin/bash \
--volume $(pwd):/app \
--env-file $(pwd)/.env
anwsonwsymous/telemap:slim
# Run with cargo
cargo run -- -c /app/config/test.json
# Run tests
cargo test