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.example
with name.env
and fill your telegram credentials.TELEGRAM_API_ID
,TELEGRAM_API_HASH
andTELEGRAM_PHONE
are required.Take creds from https://my.telegram.org/apps
- Create
json
configuration file. (examples:config/answer_machine.json.example
,config/echo.json
)
-
Build image
docker build -t anwsonwsymous/telemap:slim .
On
arm64
architecture use--platform
option to emulateamd64
docker build --platform linux/amd64 -t anwsonwsymous/telemap:slim .
-
Copy
config/echo.json.example
toconfig/echo.json
and put your chatid
-
Run container and pass newly created
json
config 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.json
id=$(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 $id
Find 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