The WhatsApp Last.fm Song Tracking Bot is a TypeScript-based bot that allows users to track their listening habits on Last.fm via WhatsApp. By sending simple commands, users can get information about their currently playing track, recent tracks, top artists, and more directly through WhatsApp.
git clone https://github.com/Nyaughh/wa-fm-bot
cd repo
npm install
# or
yarn install
.env
file in the root directory and add your MongoDB URI, Last.fm API key and secret, Spotify client ID and secret, and YouTube API key:
MONGO_URI=your_mongo_uri
LASTFM_API_KEY=your_lastfm_api_key
LASTFM_API_SECRET=your_lastfm_api_secret
SPOTIFY_CLIENT_ID=your_spotify_client_id
SPOTIFY_CLIENT_SECRET=your_spotify_client_secret
YOUTUBE_API_KEY=your_youtube_api_key
npm run build
# or
yarn build
npm start
# or
yarn start
Once the bot is running, you can interact with it through WhatsApp using the following commands:
!help
- Display the help message with a list of all commands.!hi
- Greet the bot.!sponsor
- Get information about sponsoring the bot.!lfu
- Last.fm account details.!login
- Log in to your Last.fm account.!play
- Play any song by the name and get the youtube url with an mp3 file.!artist [artist name]
- Get information about a specific artist.!fma
- Get a youtube URL of your current song.!fmall
- Get the list of all the users with their current and last listened songs.!fmp3
- Get mp3 of your current song.!fmspotify
- Get your top Spotify tracks.!grid
- Generate a grid of your top albums.!logout
- Log out from your Last.fm account.!members
- Get a list of group members logged in.!recents
- Get your recent tracks.!time
- Get the amount of time spent listening.!wac
- Get your weekly album chart.!whoknowsas [artist name]
- Get the top listeners for a specific artist.!whoknows [artist]
- Get the top listeners for a specific artist.!whoknowscurrenttrack
- Get the top listeners for the currently playing track.Example usage:
User: !fms
Bot: "User" is currently listening to: "Spotify Song URL".
If you find a bug or have a feature request, please open an issue here.
If you like this project, consider supporting us. Here are some ways you can help: