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.
- Track currently playing song
- Get recent tracks
- Display top artists
- Integration with Last.fm API
- Simple WhatsApp commands
- Support for Spotify and YouTube links
- Node.js v14 or higher
- npm or yarn
- MongoDB
- A Last.fm API key
- A Spotify API key and secret
- A YouTube API key
- A WhatsApp account
- Clone the repository:
git clone https://github.com/Nyaughh/wa-fm-bot
- Change to the project directory:
cd repo
- Install dependencies:
npm install # or yarn install
- Create a
.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
- Build the project:
npm run build # or yarn build
- Start the bot:
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:
- Starring the repository
- GitHub Sponsors
- Baileys - For the WhatsApp Web API.
- Last.fm API - For song tracking and information.
- LastFM-Typed - For Strongly typed Last.fm API SDK.
- Spotify Web API - For Spotify song links.
- YouTube Data API - For YouTube song links.