Sync mastodon toot and telegram channel or group in both direction.
Using mastodon websocket API to fetch statuses update.
(Video and other media type may not working...)
Add tag #noforward
if you don't want to forward messages.
Rename config.sample.json
to config.json
, and fill it with your own information.
Key | Explaination |
---|---|
tg_bot_token | Create a bot in Telegram using @BotFather |
channel_chat_id | Forward a message from your channel to @GetIDs Bot to get it. Should start with -100 . |
pm_chat_id | Your Account's ID. You will get it by forwarding a message to @GetIDs Bot. |
mastodon_host | Your mastodon host. e.g. hub.example.com |
mastodon_api_access_token | See How to configure your Mastodon Instance?. |
mastodon_app_name | See How to configure your Mastodon Instance?. |
mastodon_username | See How to configure your Mastodon Instance?. |
scope | Determines whether a toot should be forwarded to Telegram Channel. |
add_link_in_telegram | Decides whether to add a link in Toots forwarded to Telegram Channel. |
add_link_in_mastodon | Decides whether to add a link in Telegram Channel Messages forwarded to your Mastodon Instance. |
Settings
.Settings
find the Development
section.New Application
Application Name
. e.g. Mastodon2TG
. This will be displayed when a message is forwarded.Leave everything else default.Your access token
and paste it into mastodon_api_access_token
in config.json
.config.json
, fill in mastodon_app_name
. e.g. Mastodon2TG
config.json
, fill in mastodon_username
. e.g. yourusername
You have to use the source code under license.