#telegram-bot #telegram #mastodon #bot #bridge #forward #synchronize

bin+lib tgbot-mastodon-sync

A Telegram bot synchronizes Telegram messages to Mastodon

4 releases

0.2.2 Mar 10, 2023
0.2.1 Feb 9, 2023
0.2.0 Feb 9, 2023
0.1.0 Jan 23, 2023

#2095 in Web programming

Download history 4/week @ 2024-02-22 2/week @ 2024-02-29 2/week @ 2024-03-21 2/week @ 2024-03-28 5/week @ 2024-04-04 128/week @ 2024-04-11

137 downloads per month

AGPL-3.0-only

83KB
2K SLoC

tgbot-mastodon-sync

A Telegram bot synchronizes Telegram messages to Mastodon.

Official hosted account: @mastodon_sync_bot

Self-Host

1. Install binary

You have two ways to install the binary.

  • Install from crates.io registry.

    cargo install tgbot-mastodon-sync
    
  • Install from git repository.

    git clone https://github.com/SpriteOvO/tgbot-mastodon-sync.git
    cd tgbot-mastodon-sync
    git checkout <latest-version>
    cargo install --path .
    

Both ways are build from source.

2. Configure database

This project uses sqlite as the database engine.

Choose a file path for the database, its URL will be:

sqlite:absolute/path/to/database.sqlite

You may want to add ?mode=rwc to the end of the URL, which will make the bot automatically create the database file if it doesn't exist.

sqlite:absolute/path/to/database.sqlite?mode=rwc

Tables will be created / migrated automatically by the bot at startup.

3. Start the bot

Configure environment variables:

  • TGBOT_MASTODON_SYNC_BOT_TOKEN
  • TGBOT_MASTODON_SYNC_DATABASE_URL

Run tgbot-mastodon-sync.

Note

  • The bot requires privacy mode to be turned off, because media groups need to be cached in advance.

  • The database and memory may contain secret data, so pay attention to security.

License

This project is licensed under GNU AGPL-3.0 License.

Dependencies

~82MB
~1.5M SLoC