Skip to content

I am currently cycling from Germany to China... This is a small project to make my travels even more enjoyable :D. Music has the power to motivate me on tough days and makes good days even better. With this bot friends and family can now send me songs and accompanying messages. Feel free to use the code.

Notifications You must be signed in to change notification settings

gabrieljaegerde/spotify_telegram_bot

Repository files navigation

Credits to Excidion. I built on top of Excidion's code to customize the bot for my use case.

Spotify Telegram Bot

Setup

Before being able to use this bot, some setup work is required. Either follow the steps below, or if you want a more detailed step-by-step guide with screenshots, go check out this medium article.

Perequisites

Configuration

  • Create a new application at the spotify developer dashboard and go to it's overview page.
    • Get the Client ID and the Client Secret and copy them into the config.ini.
    • Go to Edit Settings and add http://localhost:/callback to the Redirect URIs. Click on Save.
  • Contact the @BotFather and create a new bot by texting him /newbot.
    • Follow his instructions until everything is ready to go.
    • Once the bot is created he will send you an access token. Copy this token into the config.ini.
  • Create a new openweathermap API key at the openweathermap api dashboard. Copy this token into the config.ini in the section WEATHER.
  • In the section TELEGRAM in the config.ini enter your Telegram username as the ADMIN. Your Telegram username will look like this: @username. Leave out the @ at the beginning.
  • In the section TELEGRAM in the config.ini enter a password. Tell this to your guests, so they can use the bot.
  • In the section SPOTIFY in the config.ini enter your spotify username.

While not mandatory, feel free to update all other config variables as you see fit (The average cycling speed is in km/h).

On the first start

You can now start up the bot via python main.py from the code directory. There are still two tasks to do after this, that will not be required again, unless you re-install the bot.

  • On start-up the bot will open a web page in your browser and ask for access permissions to your Spotify account. Once you give the permission you will be forwarded to another link. Copy this link into the terminal and press enter.

  • Contact the bot from the Telegram account you set as ADMIN and send him the /register command. This way, he can save your chat_id to contact you with live updates.

About

I am currently cycling from Germany to China... This is a small project to make my travels even more enjoyable :D. Music has the power to motivate me on tough days and makes good days even better. With this bot friends and family can now send me songs and accompanying messages. Feel free to use the code.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages