First of all, this project is a proof of concept that proves usability of Bash scripting language in a modern environment. It works but it still far from being a perfect app.
- Basic Telegram API - receiving updates (long polling) and sending messages.
- Basic Mopidy API - adding tracks (Google Music only, so Mopidy-Gmusic is required for mopidy backend), setting play mode and volume.
- High readability via Bash Infinity (OOP paradigm in Bash)
- JSON configuration
- caching via SQLite3
On Debian/Ubuntu you can install both via
sudo apt-get install jq sqlite3
First, clone this repository
git clone https://github.com/421p/telegram-mopidy-bash.git
Then, edit a config.json
by adding your telegram_token
and allowed_users
. Probably you also want to change mopidy_uri
if it's running somewhere else.
And now you are ready to start bot:
./bot.sh
You can modify bot commands by changing only 2 things:
- bot keyboard (
reply_markup
inconfig.json
) - executed code (
src/command/CommandStorage.sh
)
Also, you may totally remove mopidy-related code and use this as bash-telegram-bot boilerplate. Or even vice versa.