Sync mastodon toot and telegram channel or group in both direction.
Using mastodon websocket API to fetch statuses update.
- Text only message
- Text with photo
- Text with video
- Poll...
- Text only message
- Photo
- Medias...
(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. |
- Navigate to
Settings
. - In
Settings
find theDevelopment
section. - Click on
New Application
- Fill in
Application Name
. e.g.Mastodon2TG
. This will be displayed when a message is forwarded.Leave everything else default. - You have finished creating an application. Click its name to grab the required access token. Copy the value in the field
Your access token
and paste it intomastodon_api_access_token
inconfig.json
. - In
config.json
, fill inmastodon_app_name
. e.g.Mastodon2TG
- In
config.json
, fill inmastodon_username
. e.g.yourusername
- You're done!
You have to use the source code under license.
- Sync telegram channel message to mastodon.
- Support other message type. (Maybe poll?)
- Support reply message. (Maybe in both direction?)