Skip to content

Nyaughh/wa-fm-bot

Repository files navigation

WhatsApp Last.fm Song Tracking Bot

Table of Contents

Introduction

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.

Features

  • Track currently playing song
  • Get recent tracks
  • Display top artists
  • Integration with Last.fm API
  • Simple WhatsApp commands
  • Support for Spotify and YouTube links

Installation

Prerequisites

  • 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

Steps

  1. Clone the repository:
    git clone https://github.com/Nyaughh/wa-fm-bot
  2. Change to the project directory:
    cd repo
  3. Install dependencies:
    npm install
    # or
    yarn install
  4. 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
  5. Build the project:
    npm run build
    # or
    yarn build
  6. Start the bot:
    npm start
    # or
    yarn start

Usage

Once the bot is running, you can interact with it through WhatsApp using the following commands:

General Commands

  • !help - Display the help message with a list of all commands.
  • !hi - Greet the bot.
  • !sponsor - Get information about sponsoring the bot.

LastFM Commands

  • !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".

Issues

If you find a bug or have a feature request, please open an issue here.

Support

If you like this project, consider supporting us. Here are some ways you can help:

Acknowledgements

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published