{"id":18870065,"url":"https://github.com/iteam1337/sonos-wejay","last_synced_at":"2025-07-08T09:34:57.357Z","repository":{"id":33947822,"uuid":"151966092","full_name":"Iteam1337/sonos-wejay","owner":"Iteam1337","description":"Slack integration for a local Sonos system","archived":false,"fork":false,"pushed_at":"2023-01-04T21:37:37.000Z","size":5005,"stargazers_count":20,"open_issues_count":18,"forks_count":0,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-28T04:11:18.422Z","etag":null,"topics":["music","reasonml","slack","sonos","spotify"],"latest_commit_sha":null,"homepage":"","language":"Reason","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/Iteam1337.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2018-10-07T17:16:56.000Z","updated_at":"2023-03-17T19:23:58.000Z","dependencies_parsed_at":"2023-01-15T03:32:22.924Z","dependency_job_id":null,"html_url":"https://github.com/Iteam1337/sonos-wejay","commit_stats":null,"previous_names":[],"tags_count":63,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Iteam1337%2Fsonos-wejay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Iteam1337%2Fsonos-wejay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Iteam1337%2Fsonos-wejay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Iteam1337%2Fsonos-wejay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Iteam1337","download_url":"https://codeload.github.com/Iteam1337/sonos-wejay/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248904622,"owners_count":21180836,"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":["music","reasonml","slack","sonos","spotify"],"created_at":"2024-11-08T05:18:41.220Z","updated_at":"2025-04-14T15:20:40.247Z","avatar_url":"https://github.com/Iteam1337.png","language":"Reason","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sonos Wejay\n\n[![](https://github.com/Iteam1337/sonos-wejay/workflows/Release/badge.svg)](https://github.com/Iteam1337/sonos-wejay/actions?workflow=Release)\n\nWejay is a music collaboration bot for Slack that can be used to add music to a local Sonos system. It needs to be started on the same network as your Sonos system in order to communicate with the speakers.\n\n![Demo of Wejay Slack bot](/docs/wejay.gif)\n\n## Get started\n\n### Prerequisites\n\nStart by creating a `.env` file in the root directory of the project. This is for the Spotify search feature and to allow the bot to interact with Slack. It should contain\n\n```\nSPOTIFY_ID=spotify-token-here\nSPOTIFY_SECRET=spotify-secret-here\nSLACK_TOKEN=slack-token-here\nWEJAY_IP=ip-of-the-speaker\n```\n\nSpotify token/secret can be generated by creating an app at https://developer.spotify.com/. Slack token can be found after adding the bot to your Slack below. The value for `WEJAY_IP` can be found in \"About My Sonos System\" of the Sonos Controller app, choose the IP of the speaker you'd like to send music to.\n\n```\n$ git clone https://github.com/Iteam1337/sonos-wejay.git\n$ cd sonos-wejay\n$ npm install\n$ npm build \u0026\u0026 npm run dev\n```\n\nThis will compile the Reason code and start up the Express app.\n\n## Testing it out\n\n1. The easiest way to start testing is using [ngrok](https://ngrok.com/). After you've installed `ngrok`, open another terminal and run `ngrok http 3000`. This will create a tunnel to you local environment.\n2. Go to https://api.slack.com/apps and create a new app\n3. Inside _OAuth \u0026 Permissions_ you'll find \"Bot User OAuth Access Token\" which is the token that should be added in your `.env` above.\n4. Go to _Interactive Components_ and enable it. In the request url enter one of the urls provided by `ngrok` (http or https) and the route `/action`, i.e. https://127.0.0.1/action\n5. Also on _Interactive Components_ add a action. Give it the name \"Queue track\" and description and callback id \"queue\"\n6. Go to _Event Subscriptions_ and enable it. In the request url use the same url as above but use the route `/event`\n7. Also on _Event Subscriptions_ add a \"Bot User Event\". The best one is `message.im`, which means you can send commands to the bot in private messages\n8. You should be able to send some commands to the bot in Slack now, try sending `help` to see all available commands\n\n## Available commands\n\n| Command                           | Shorthand                | Description                                                  |\n| --------------------------------- | ------------------------ | ------------------------------------------------------------ |\n| `blame`                           |                          | Who added the track? (requires MySQL database)               |\n| `clear`                           |                          | Reset playlist                                               |\n| `currentqueue`                    | `getqueue`, `gq`, `cq`   | Display upcoming tracks                                      |\n| `fullqueue`                       | `fq`                     | Display all tracks currently in the queue                    |\n| `help`                            |                          | Display the help text                                        |\n| `mute`                            |                          | Mute                                                         |\n| `mostplayed`                      |                          | List the most played tracks (requires MySQL database)        |\n| `next`                            | `skip`                   | Skip one track forward                                       |\n| `nowplaying`                      | `np`                     | Display what's playing right now                             |\n| `remove \u003cnumberOfTracks\u003e \u003cindex\u003e` | `rm`                     | Remove tracks                                                |\n| `pause`                           |                          | Pause                                                        |\n| `play`                            |                          | Play                                                         |\n| `playtrack \u003ctrackNumber\u003e`         |                          | Play track number                                            |\n| `playlatest`                      | `pl`                     | Play latest track                                            |\n| `previous`                        |                          | Go back one track                                            |\n| `queue \u003cSpotify URI\u003e`             | `q \u003cSpotify URI\u003e`        | Queue a track using a Spotify URI                            |\n| `search \u003cyour search string\u003e`     | `s \u003cyour search string\u003e` | Search Spotify for a track                                   |\n| `toplist`                         |                          | List top Wejayers (requires MySQL database)                  |\n| `unmute`                          |                          | Unmute                                                       |\n| `volume \u003c0-100\u003e`                  |                          | Set volume, if no number is provided displays current volume |\n\n### Copy and paste from Spotify\n\nYou can also select a couple of tracks in Spotify, press `cmd+c` (Mac) / `ctrl+c` (Windows), paste the copied information to the Wejay bot and send the message. Wejay will add all of your tracks at the end of the queue! :tada:\n\n## Database\n\nSome of the commands, like `blame` and `toplist` requires that you have a MySQL database that the service can access. We've included a `docker-compose.yml` that you can use to spin up a database.\n\n## Contributors\n\nThanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://willcodefor.beer/\"\u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/1478102?v=4\" width=\"100px;\" alt=\"Rickard Laurin\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eRickard Laurin\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/Iteam1337/sonos-wejay/commits?author=believer\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/Iteam1337/sonos-wejay/commits?author=believer\" title=\"Documentation\"\u003e📖\u003c/a\u003e \u003ca href=\"#ideas-believer\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e \u003ca href=\"#review-believer\" title=\"Reviewed Pull Requests\"\u003e👀\u003c/a\u003e \u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/lessp\"\u003e\u003cimg src=\"https://avatars3.githubusercontent.com/u/17602389?v=4\" width=\"100px;\" alt=\"Tom Ekander\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eTom Ekander\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/Iteam1337/sonos-wejay/commits?author=lessp\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"#ideas-lessp\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/Jimjardland\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/u/8521353?v=4\" width=\"100px;\" alt=\"Jimmy Jardland\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eJimmy Jardland\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/Iteam1337/sonos-wejay/commits?author=Jimjardland\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"#ideas-Jimjardland\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e \u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"http://nilssonnils.se\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/u/3233182?v=4\" width=\"100px;\" alt=\"Nils Nilsson\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eNils Nilsson\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/Iteam1337/sonos-wejay/commits?author=dubbelnisse\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"#ideas-dubbelnisse\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/faroutchris\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/u/3967818?v=4\" width=\"100px;\" alt=\"faroutchris\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003efaroutchris\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/Iteam1337/sonos-wejay/commits?author=faroutchris\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-enable --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiteam1337%2Fsonos-wejay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiteam1337%2Fsonos-wejay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiteam1337%2Fsonos-wejay/lists"}