Since Slack has now removed the ability to create new Legacy Tokens you'll need to create a Slack App and find your member ID to enable slack-fm functionality.
- Navigate to https://api.slack.com/apps
- Click "Create New App", give it a name like "slack-fm", and choose your Workspace.
- Click "Add features and functionality"
- Select "Permissions" and scroll down to "Scopes"
- Add 2x "User Token Scopes"
users.profile:write
users:read
- Copy the token at the top of this page
The above instructions create a Workspace token which has full access to your... Workspace. For example, if you provide someone else's member ID in your config file slack-fm will update their status.
Please exercise reasonable discretion when configuring slack-fm for your member ID only. We wouldn't want anyone getting confused or upset about their status changing to the great music you're listening to would we 😅
If your team has multiple people that would like to run slack-fm then each person must configure and run their own instance of it (you can use the same Workspace token/app). Multiple Last.fm account support may exist in the future if there's enough demand for it.
- Go to Slack
- Click your profile image in the top right and select "View Profile"
- Click the "More" button and select "Copy member ID"
- Create an API account here
- Copy the API key and shared secret
Copy the below snippet (or the sample in config.sample.yml
)
and create a file called config.yml
somewhere replacing the properties with
what you created above.
All the options here are required, the sample below contains some sensible defaults for the app.
# config.yml
app:
emoji: ':headphones:'
separator: '·'
update_interval: 1
update_weekends: false
update_hour_start: 8
update_hour_end: 18
lastfm:
username: 'your_lastfm_username'
api_key: '00000000000000000000000000000000'
shared_secret: '00000000000000000000000000000000'
slack:
- user_id: 'U00000000'
token: 'xoxp-XXX-XXX-XXX-XXX'
- user_id: 'U00000000'
token: 'xoxp-XXX-XXX-XXX-XXX'
This file will be used in the next step.
I designed this to be easily self hosted on either your local machine or on a server somewhere with Docker. Slack-fm is automatically built and versioned on Docker Hub based on GitHub activity.
Define a docker-compose.yml
file with the following content being careful to
replace the volumes
property with the correct config.yml
path.
# docker-compose.yml
version: '3.7'
services:
slack_fm:
image: jckcthbrt/slack-fm:latest
container_name: slack_fm
restart: unless-stopped
environment:
TZ: '<YOUR_TIMEZONE>'
volumes:
- '</LOCAL/PATH/TO/config.yml>:/data/config.yml'
docker-compose up