This script creates a telegram bot that can send toot to a given mastodon instance via access token.
Get the token for your telegram bot from @BotFather.
pip install python-telegram-bot --upgrade
pip3 install Mastodon.py
python3 tg-mastodon.py $telegram_TOKEN
python3 tg-mastodon.py --admin $telegram_userid $telegram_TOKEN
On server, you can run the script from a process management tool like pm2
pm2 start 'python3 tg-mastodon.py $telegram_TOKEN'
- Set mastodon's instance and access token
Go to Preference/Development/New Applications to create a new application and get access token.
Needed access scope is: read:accounts write:media write:statuses
/set_instance url
/set_accesstoken accesstoken
- Toot
Toot directly from your telegram bot!
Set private or unlisted visibility (default is public) by the command:
/set_visibility visibility
- Clone the project.
- In python 3 environment. Install python-telegram-bot and Mastodon.py package
- Admin mode
- Test
- Send toot in different status
- Send toots in other formats (video etc.)
- Multiple instances
- Stream
- Heroku
- VPS
- Online python IDE