Skip to content

Surfboardv2ray/telegram-spotbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

A simple bot to get Spotify's features in Telegram.

Disclaimer

This code is developed for educational purposes only and no abuse of any services, either Github, Spotify, or Telegram is instended.

How to

  • Create a telegram bot using @BotFather and get your bot API token.
  • Create an Actions Secret called TELEGRAM_BOT_TOKEN and set the value as your bot API token.
  • Make sure you've allowed Read and Write Permission to github actions before running the workflow.
  • To avoid extended workflow run for free users and avoid abuse of services, tg-bot.yml is set out to cancel the workflow after a limited time. Adjust it under timeout-minutes, capped at 6 hours due to Github policies (360 minutes).
  • Run the workflow and /start your Telegram bot.

Running Locally

  • Resources to run locally are available under Releases.
  • Install dependencies via requirements.txt.
  • Edit tg-bot.py and replace YOUR_BOT_TOKEN with your bot API Token.
  • Run the script and /start your Telegram bot.

Advanced

  • Current version of the bot only supports Spotify links. However, to use search the function, you're also gonna need SPOTIFY_CLEINT_ID and SPOTIFY_CLIENT_SECRET.
  • That's why we added the source code with search ability under advanced folder to keep the main code simple.
  • Steps:
    • Create a spotify account, then Create a Spotify App.
    • Get your Spotify Client ID and Client Secret and put them in your Github Actions Secrets.
    • Use the Github action workflow and python script inside the advanced directory. Make sure you've set TELEGRAM_BOT_TOKEN in your secrets as well.
    • If running locally, you could simply hard-code the three environment variables right inside the python script.