Skip to content

Simple discord bot to post any new songs added to a spotify playlist. Fetches every X seconds because Spotify doesnt have webhooks yet.

License

Notifications You must be signed in to change notification settings

ButternCream/Spotty

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spotty - The Spotify music sharing bot

To simply add the bot to your server just click here. Then read steps 5 and 6 under How To Use

Its currently just running on my raspberry pi but I eventually might move it to a VPC

Note: Make sure it has permission to send and read messages

Spotty will fetch songs in the specified playlist every X seconds.
If it finds any new songs it will post it to the specified discord channel in the database

Todo 🚧

  • Wait for spotify webhooks 😟
  • Exception handling for the database ✔️ (kind of)
  • Better permissions for things like !stop and !track ✔️
  • Limit the channels in which !track can be called ❌
  • !random 🆔 - Randomly pick a song from the specific playlist ✔️
  • !where - List the channels in the server that are tracking playlists ❌
  • !tracking - returns the unique db id of an entry along with the playlist name ✔️
  • !stop 🆔 - Stop tracking the specified playlist. Where id will be the specified unique id from !tracking ✔️
  • !link 🆔 - Get the link of the specified playlist. id from !tracking ✔️
  • Have the option for 🆔 to also be the spotify playlist id instead of just being the unique id from the database ✔️
  • Fix / Update logging. (Use RotatingFileHandler and logging config file) ✔️ (Using RotatingFileHandler)
  • more TBD

Commands ❗

!help - As you'd expect
!track <playlist-id> <playlist-id> ... - Will post new songs added to the playlist in the discord channel you use this command in (see below)
!tracking - List the names and ids of what the current channel is tracking
!stop <id> - Stop the current channel from tracking anything or a specific playlist if the id from !tracking is specified
!purgeme - Removes ALL of your tracking entries in the database
!link <id> - Get the link of a playlist you are tracking. Get id from !tracking
!random <id> - Gets a random song from the playlist specified. id can be from !tracking or the playlists id

How To Use ❓

  1. Clone repo
  2. pip install -r requirements.txt
  3. Configure a config.py file (see below)
  4. Add your bot to your server and make sure it has permission to send messages
  5. Make a role called 'Spotty Admin'
  6. Assign the role whoever you want to be able to use the !track command

Until I figure out a better way of handling permissions, this is how it works so everyone cant !track

Sample Config File

import os
import pytz

client_id = 'SPOTIFY_CLIENT_ID'
client_secret = 'SPOTIFY_SECRET'
spotty_token = 'BOT_TOKEN'

delay = 30
db_location = r'db/spotty.db' # Local db

spotify_user_id = 'your user id'

old_time = pytz.timezone("UTC") # Spotify's timestamps
new_time = pytz.timezone("America/Los_Angeles") # Your timezone

What It Looks Like

Tracking Track Stop StopID

About

Simple discord bot to post any new songs added to a spotify playlist. Fetches every X seconds because Spotify doesnt have webhooks yet.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages