{"id":23196658,"url":"https://github.com/marcdonald/twitch-spotify-request-bot","last_synced_at":"2025-08-18T22:31:58.473Z","repository":{"id":42077031,"uuid":"283900110","full_name":"MarcDonald/twitch-spotify-request-bot","owner":"MarcDonald","description":"This is a bot that listens to the chat of a given Twitch stream for messages with a Spotify song link in them and then adds that song to a playlist and/or your queue.","archived":false,"fork":false,"pushed_at":"2023-07-20T09:23:53.000Z","size":688,"stargazers_count":30,"open_issues_count":2,"forks_count":22,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-12-12T08:39:26.330Z","etag":null,"topics":["hacktoberfest","livestream","song","songs","spotify","spotify-api","spotify-playlist","spotify-web-api","twitch","twitch-bot","twitch-tv","twitchtv"],"latest_commit_sha":null,"homepage":"https://www.marcdonald.com","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MarcDonald.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-30T23:52:40.000Z","updated_at":"2024-11-14T23:35:21.000Z","dependencies_parsed_at":"2023-02-13T20:05:21.754Z","dependency_job_id":null,"html_url":"https://github.com/MarcDonald/twitch-spotify-request-bot","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcDonald%2Ftwitch-spotify-request-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcDonald%2Ftwitch-spotify-request-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcDonald%2Ftwitch-spotify-request-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcDonald%2Ftwitch-spotify-request-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MarcDonald","download_url":"https://codeload.github.com/MarcDonald/twitch-spotify-request-bot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230284122,"owners_count":18202339,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hacktoberfest","livestream","song","songs","spotify","spotify-api","spotify-playlist","spotify-web-api","twitch","twitch-bot","twitch-tv","twitchtv"],"created_at":"2024-12-18T14:19:56.272Z","updated_at":"2024-12-18T14:19:56.949Z","avatar_url":"https://github.com/MarcDonald.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Twitch Spotify Request Bot\n\n## What is this?\n\nThis is a bot that listens to the chat of a given Twitch stream for messages with a Spotify song link in them and then\nadds that song to a playlist and/or your queue. The Spotify link must be at the start of the message in order to be\npicked up.\n\n✔️ Message that WOULD be picked up:\n\n```\n!prefix https://open.spotify.com/track/4uLU6hMCjMI75M1A2tKUQC?si=x-_FFgqBRB20mzW_lM7kDQ pls play this, it's a bop\n```\n\n❌ Message that WOULD NOT be picked up:\n\n```\n!prefix this is a bop can you please play this https://open.spotify.com/track/4uLU6hMCjMI75M1A2tKUQC?si=x-_FFgqBRB20mzW_lM7kDQ\n```\n\n## Setup\n\n### Prerequisites\n\n- Some basic programming knowledge (running terminal commands and editing `.env` files)\n- [Node](https://nodejs.org/en/) (developed and tested on 18 - your mileage may vary on other versions)\n- A Spotify account\n- A GitHub Personal Access Token (PAT) with the `read:packages` scope stored in an environment variable\n  called `GH_PKG_AUTH_TOKEN` - [Click here to generate one](https://github.com/settings/tokens/new?description=Twitch%20Spotify%20Request%20Bot\u0026scopes=read%3Apackages)\n\n### Running\n\n1.  Run `npm install`\n\n2.  Go to the [Spotify developer dashboard](https://developer.spotify.com/dashboard/)\n    and create a new application. The app can have whatever name and description you want\n\n3.  Once the app is created, click on Edit Settings and add a redirect URL of\n    `http://localhost:8000/spotifyAuth` (NB: the port will be whatever you have set as the `AUTH_SERVER_PORT` in\n    the `./.env` file, by default it is 8000)\n\n4.  Create a `./.env` file based on `./.env.template` file and fill in the fields\n\n    - The playlist ID can be found by either:\n\n      - Right-clicking on the playlist -\u003e clicking Share -\u003e Copy Spotify URI and then copying the ID after `spotify:playlist:`\n        e.g. `spotify:playlist:{THIS_STRING_IS_THE_ID}`)\n      - Or by right-clicking on the playlist -\u003e clicking Share -\u003e Copy Link to Playlist and then copying the ID after `https://open.spotify.com/playlist/` and before the `?si=`\n        e.g. `https://open.spotify.com/playlist/{THIS_STRING_IS_THE_ID}?si=12345123`)\n\n    - The Spotify client ID and secret are obtained from the application you created in the Spotify developer dashboard\n\n    - If you wish to have chat feedback, set `CHAT_FEEDBACK` to true then generate a\n      [Twitch Chat OAuth Token](https://twitchapps.com/tmi/) and set it as the `TWITCH_TOKEN` field in the `.env` file.\n      Also\n      set the `BOT_USERNAME` field to the name of the account you wish to use (must be the same account you generate the\n      OAuth token for)\n\n          \t**Do NOT commit this file to Git as it will contain SECRETS to log in as you!**\n\n5.  Run `npm run build \u0026\u0026 npm start` to start the bot\n\n6.  Open the authorization link and give the app the required permissions\n\n7.  If you have `ADD_TO_QUEUE` toggled on, ensure you have the Spotify client open and that it is active (i.e. is playing\n    a song)\n\n8.  Type a Spotify link in the chat (ensuring the link is the first piece of text in the message)\n    and make sure it shows up in your desired playlist (Spotify links should start\n    with `https://open.spotify.com/track/`)\n\n9.  If there's a problem with Spotify authorization at any point, try deleting the\n    `spotify-auth-store.json` file and starting the app again\n\n#### (Optional) Generating a binary file\n\n1. Run `bash ./build.sh`. This will automatically compile from source using `npm` and then build OS-native binaries\n   using `pkg`\n\n2. Run the freshly compiled binary for your OS in `./out`.\n\n## Open Source Libraries Used\n\n### [Spotify Web API Node](https://github.com/thelinmichael/spotify-web-api-node)\n\nUsed for connecting to and performing actions using Spotify\n\nMIT License\n\n### [tmi.js](https://github.com/tmijs/tmi.js)\n\nUsed for connecting to Twitch chat\n\nMIT License\n\n### [Express](https://github.com/expressjs/express)\n\nUsed for creating a temporary local web server to retrieve the callback from the Spotify authorization\n\nMIT License\n\n### [Material Design Icons](https://github.com/google/material-design-icons)\n\nUsed for the icon\n\nApache 2 License\n\n## Contributors\n\nCheckout the [Contributors file](./CONTRIBUTORS.md) to see everyone who has helped out with the bot\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcdonald%2Ftwitch-spotify-request-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcdonald%2Ftwitch-spotify-request-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcdonald%2Ftwitch-spotify-request-bot/lists"}