Kotlin-based Telegram bot for tracking and updating information about user's music preferences based on Last.fm data. The bot periodically checks the user's top artists and sends updates to the specified Telegram channel or chat.
Insert the required values into src/main/resources/config.properties:
Data.apiKey=ap1K3y40r1astFm
Data.user=user_from_last_fm
Data.tokenBot=1234567890:tokenForYourTelegramBot
Data.chatId=chatId for your chat/channel
Data.messageId=id of the message that will be changed in chat/channel
Data.userAgent=user agent for Last.fm library
Data.updateInterval=interval in minutes
Data.limitForArtists=limit for list of artists
Data.limitForTracks=limit for list of recent tracksThe chatId and messageId fields are filled in together: the id of your chat/channel is inserted into chatId, and the id of the message from your chat/channel is inserted into messageId.
❗️Before you run the bot, add it to your chat/channel and give it admin if you add it to the channel ❗️
If you are using Linux, you just need to run the startMusicBot.sh file (you can even move it to another location if you pass the directory with the gradlew file as an argument). Otherwise, you just need to type "gradlew run" while in the directory with the bot in your shell. Enjoy it!
To change the language, you can specify the language as an argument to --language when running the bot via .sh script. The list of currently available languages: English (default), Russian, Ukrainian.
You can also create your own localization. To do this, change the string values from the strings_en.json file to your own and the resulting file "strings_[your_language].json". For example, "strings_Chinese.json" and pass your language to the script: "-l Chinese"
Kotlin-telegram-bot for Telegram API.
Slf4j for logging.
Konfig for work with properties file.
kotlinx.coroutines for coroutines (async).
ktor for api requests.
MusicProfileBot is under the MIT License. See the LICENSE for more information.
