A last.fm bot for Slack
slack.fm is a Slack bot that lets you connect your Last.fm account to view your music stats, get song/album/artist info, and more—all from within Slack. Perfect for sharing your music taste, discovering new tracks, and having fun with your team.
- Link your Last.fm account to Slack
- View your or others now playing track, profile, top artists, albums, and songs
- Get fun roasts of your music taste
- See detailed stats for songs, albums, and artists
- Easy-to-use Slack slash commands
To self-host slack.fm, follow these steps:
-
Clone the repository:
git clone https://github.com/bananajeanss/slack.fm.git cd slack.fm -
Install the dependencies:
npm install
-
Set up your Slack app:
- Go to the Slack API and create a new app using the slackmanifest.json file.
- Double-check that everything is set up correctly.
-
Create a
.envfile
Copy.env.exampleand fill in the required variables. -
Run the app:
npm start
SLACK_CLIENT_ID– Your Slack app client IDSLACK_CLIENT_SECRET– Your Slack app client secretSLACK_BOT_TOKEN– Your Slack bot token (starts withxoxb-)SLACK_APP_TOKEN– Your Slack app-level token (starts withxapp-)SLACK_SIGNING_SECRET– Your Slack signing secretLASTFM_API_KEY– Your Last.fm API keyLASTFM_SHARED_SECRET– Your Last.fm shared secretLASTFM_CALLBACK_URL– OAuth callback URL for Last.fm (must be a valid URL)SPOTIFY_CLIENT_ID– Your Spotify client IDSPOTIFY_CLIENT_SECRET– Your Spotify client secretUSE_LANGUAGE_FILTERING–trueorfalseto enable/disable language filtering for outputDB_PATH– Path to the SQLite database file (default:./utils/slackfm.db)
Once the bot is running and added to your Slack workspace, you can use these basic commands to get started:
| Command | Description |
|---|---|
/link |
Link your Last.fm account |
/unlink |
Unlink your Last.fm account |
/nowplaying |
Shows your (or another user’s) current track |
/profile |
Shows Last.fm profile info |
/artist |
Shows info about your last played artist |
/album |
Shows info about your last played album |
/song |
Shows info about your last played song |
/whoknows |
Shows top listeners for an artist |
/whoslistening |
Shows who is listening to a track |
/roast |
Get roasted for your music taste |
More commands can be found in the commands.md file.
Contributions are welcome! Please fork the repository and create a pull request. For major changes, open an issue first to discuss what you’d like to change.
For further information on contributing, please refer to the CONTRIBUTING.md file.
This project is licensed under the MIT License. See the LICENSE file for details.
- Last.fm API
- Slack API/Bolt
- Spotify API
- SQLite - Local database storage
- Express.js - Web framework for routing
- Axios - HTTP client for API requests