https://github.com/421p/telegram-mopidy-bash
Proof of Concept | Basic Mophpidy in OOP Bash
https://github.com/421p/telegram-mopidy-bash
bash bot mopidy music-server telegram
Last synced: 3 months ago
JSON representation
Proof of Concept | Basic Mophpidy in OOP Bash
- Host: GitHub
- URL: https://github.com/421p/telegram-mopidy-bash
- Owner: 421p
- License: bsd-3-clause
- Created: 2018-06-10T01:34:25.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-06-11T00:49:42.000Z (about 8 years ago)
- Last Synced: 2025-07-29T04:28:53.239Z (11 months ago)
- Topics: bash, bot, mopidy, music-server, telegram
- Language: Shell
- Homepage:
- Size: 43.9 KB
- Stars: 4
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Proof of Concept
[](https://gitter.im/telegram-mopidy-bash/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
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.
## Features
* 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](https://github.com/niieani/bash-oo-framework) (OOP paradigm in Bash)
* JSON configuration
* caching via SQLite3
## Dependencies
* Bash 4
* [jq](https://stedolan.github.io/jq/)
* [SQLite3](https://www.sqlite.org/index.html)
On Debian/Ubuntu you can install both via
```sh
sudo apt-get install jq sqlite3
```
## Installation
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
```
## Modifying bot for your own needs
You can modify bot commands by changing only 2 things:
* bot keyboard (`reply_markup` in `config.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.