> ## Documentation Index
> Fetch the complete documentation index at: https://docs.celestia.rest/llms.txt
> Use this file to discover all available pages before exploring further.

# Last.fm Integration

> Track and share your music activity directly in Discord with full Last.fm integration

## Overview

The Last.fm integration allows users to link their Last.fm accounts and access a full suite of music tracking commands directly within Discord. From checking what's currently playing to comparing music tastes with other server members, the system provides real-time scrobble data, artist info, collage generation, server-wide leaderboards, and more — all rendered with a clean, interactive interface using Discord Components V2.

***

## Getting Started

Before using any Last.fm commands, you must link your account using OAuth authentication.

<Steps>
  <Step title="Run the login command">
    Use `~lastfm login` to receive a DM with your personal authentication link.
  </Step>

  <Step title="Authenticate on Last.fm">
    Click the link in your DMs and approve the connection on the Last.fm website.
  </Step>

  <Step title="You're linked">
    Your account is linked automatically once you approve. You can now use all Last.fm commands.
  </Step>
</Steps>

<Tip>
  Make sure your DMs are open from server members so the bot can send you the login link.
</Tip>

***

## Commands

<AccordionGroup>
  <Accordion title="lastfm login" icon="link">
    Link your Last.fm account via OAuth. Sends a DM with a personalized authentication link.

    <CodeGroup>
      ```bash Syntax theme={null}
      ~lastfm login
      ```

      ```bash Example theme={null}
      ~lastfm login
      ```
    </CodeGroup>

    **Aliases:** `lfm login`
  </Accordion>

  <Accordion title="lastfm logout" icon="right-from-bracket">
    Unlink your Last.fm account from the bot.

    <CodeGroup>
      ```bash Syntax theme={null}
      ~lastfm logout
      ```

      ```bash Example theme={null}
      ~lastfm logout
      ```
    </CodeGroup>

    **Aliases:** `lfm logout`
  </Accordion>

  <Accordion title="lastfm np" icon="play">
    Show what you or another user is currently listening to (or last played). Displays track name, artist, album, artwork, and your personal play count.

    <CodeGroup>
      ```bash Syntax theme={null}
      ~lastfm np [@user/username]
      ```

      ```bash Example theme={null}
      ~lastfm np
      ~lastfm np @user
      ~lastfm np someusername
      ```
    </CodeGroup>

    **Aliases:** `lfm np`, `lfm nowplaying`
  </Accordion>

  <Accordion title="lastfm recent" icon="clock-rotate-left">
    Show the last 10 tracks played by you or another user, with the currently playing track highlighted.

    <CodeGroup>
      ```bash Syntax theme={null}
      ~lastfm recent [@user/username]
      ```

      ```bash Example theme={null}
      ~lastfm recent
      ~lastfm recent @user
      ```
    </CodeGroup>

    **Aliases:** `lfm r`, `lfm recent`
  </Accordion>

  <Accordion title="lastfm artist" icon="microphone">
    Show detailed info about an artist including global listener count, scrobbles, genre tags, bio, and your personal play count.

    <CodeGroup>
      ```bash Syntax theme={null}
      ~lastfm artist <name> [@user]
      ```

      ```bash Example theme={null}
      ~lastfm artist Kanye West
      ~lastfm artist Kanye West @user
      ```
    </CodeGroup>

    **Aliases:** `lfm a`, `lfm artist`
  </Accordion>

  <Accordion title="lastfm album" icon="record-vinyl">
    Show info about an album including your play count, track count, and genre tags. Use `Artist - Album` format or omit the artist to pull from your currently playing track.

    <CodeGroup>
      ```bash Syntax theme={null}
      ~lastfm album <Artist - Album> [@user]
      ```

      ```bash Example theme={null}
      ~lastfm album Kanye West - DONDA
      ~lastfm album Kanye West - DONDA @user
      ```
    </CodeGroup>

    **Aliases:** `lfm al`, `lfm album`
  </Accordion>

  <Accordion title="lastfm track" icon="music">
    Show info about a track including your play count, duration, and genre tags. Use `Artist - Track` format or omit the artist to pull from your currently playing track.

    <CodeGroup>
      ```bash Syntax theme={null}
      ~lastfm track <Artist - Track> [@user]
      ```

      ```bash Example theme={null}
      ~lastfm track Kanye West - Runaway
      ~lastfm track Kanye West - Runaway @user
      ```
    </CodeGroup>

    **Aliases:** `lfm tr`, `lfm track`
  </Accordion>

  <Accordion title="lastfm collage" icon="grid">
    Generate a grid of your top album artwork. Supports custom grid sizes from 1×1 to 5×5 and all standard time periods.

    <CodeGroup>
      ```bash Syntax theme={null}
      ~lastfm collage [NxN] [@user] [period]
      ```

      ```bash Example theme={null}
      ~lastfm collage
      ~lastfm collage 4x4
      ~lastfm collage 3x3 @user weekly
      ~lastfm collage 5x5 overall
      ```
    </CodeGroup>

    **Aliases:** `lfm col`, `lfm collage`
    **Periods:** `overall` `7day` `1month` `3month` `6month` `12month`
  </Accordion>

  <Accordion title="lastfm topartists" icon="star">
    Show your top 10 artists for a given time period with play counts.

    <CodeGroup>
      ```bash Syntax theme={null}
      ~lastfm topartists [@user] [period]
      ```

      ```bash Example theme={null}
      ~lastfm topartists
      ~lastfm topartists @user weekly
      ~lastfm topartists overall
      ```
    </CodeGroup>

    **Aliases:** `lfm ta`, `lfm topartists`
    **Periods:** `overall` `7day` `1month` `3month` `6month` `12month`
  </Accordion>

  <Accordion title="lastfm toptracks" icon="list-music">
    Show your top 10 tracks for a given time period with play counts.

    <CodeGroup>
      ```bash Syntax theme={null}
      ~lastfm toptracks [@user] [period]
      ```

      ```bash Example theme={null}
      ~lastfm toptracks
      ~lastfm toptracks @user monthly
      ~lastfm toptracks 12month
      ```
    </CodeGroup>

    **Aliases:** `lfm tt`, `lfm toptracks`
    **Periods:** `overall` `7day` `1month` `3month` `6month` `12month`
  </Accordion>

  <Accordion title="lastfm topalbums" icon="album-collection">
    Show your top 10 albums for a given time period with play counts.

    <CodeGroup>
      ```bash Syntax theme={null}
      ~lastfm topalbums [@user] [period]
      ```

      ```bash Example theme={null}
      ~lastfm topalbums
      ~lastfm topalbums @user overall
      ~lastfm topalbums 7day
      ```
    </CodeGroup>

    **Aliases:** `lfm tab`, `lfm topalbums`
    **Periods:** `overall` `7day` `1month` `3month` `6month` `12month`
  </Accordion>

  <Accordion title="lastfm profile" icon="user">
    Show a user's Last.fm profile stats including total scrobbles, unique artists, albums, tracks, registration date, and country.

    <CodeGroup>
      ```bash Syntax theme={null}
      ~lastfm profile [@user/username]
      ```

      ```bash Example theme={null}
      ~lastfm profile
      ~lastfm profile @user
      ~lastfm profile someusername
      ```
    </CodeGroup>

    **Aliases:** `lfm p`, `lfm profile`
  </Accordion>

  <Accordion title="lastfm scrobbles" icon="chart-simple">
    Show total scrobble count with daily and weekly averages and the date scrobbling began.

    <CodeGroup>
      ```bash Syntax theme={null}
      ~lastfm scrobbles [@user/username]
      ```

      ```bash Example theme={null}
      ~lastfm scrobbles
      ~lastfm scrobbles @user
      ```
    </CodeGroup>

    **Aliases:** `lfm sc`, `lfm scrobbles`
  </Accordion>

  <Accordion title="lastfm milestone" icon="trophy">
    View your scrobble milestone progress. Shows your last reached milestone and the next one, with an estimated number of days to reach it based on your daily average.

    <CodeGroup>
      ```bash Syntax theme={null}
      ~lastfm milestone [@user/username]
      ```

      ```bash Example theme={null}
      ~lastfm milestone
      ~lastfm milestone @user
      ```
    </CodeGroup>

    **Milestones:** 1K · 5K · 10K · 25K · 50K · 100K · 250K · 500K · 1M

    **Aliases:** `lfm milestone`
  </Accordion>

  <Accordion title="lastfm streak" icon="fire">
    Show your current consecutive daily listening streak and today's scrobble count.

    <CodeGroup>
      ```bash Syntax theme={null}
      ~lastfm streak [@user/username]
      ```

      ```bash Example theme={null}
      ~lastfm streak
      ~lastfm streak @user
      ```
    </CodeGroup>

    **Aliases:** `lfm streak`
  </Accordion>

  <Accordion title="lastfm cover" icon="image">
    Display the full-size album artwork for your current or last played track.

    <CodeGroup>
      ```bash Syntax theme={null}
      ~lastfm cover [@user/username]
      ```

      ```bash Example theme={null}
      ~lastfm cover
      ~lastfm cover @user
      ```
    </CodeGroup>

    **Aliases:** `lfm cover`
  </Accordion>

  <Accordion title="lastfm chart" icon="chart-bar">
    Display a visual bar chart of your top artists, tracks, or albums for a given period.

    <CodeGroup>
      ```bash Syntax theme={null}
      ~lastfm chart [artists/tracks/albums] [period]
      ```

      ```bash Example theme={null}
      ~lastfm chart
      ~lastfm chart tracks weekly
      ~lastfm chart albums overall
      ~lastfm chart artists 1month
      ```
    </CodeGroup>

    **Aliases:** `lfm chart`
    **Periods:** `overall` `7day` `1month` `3month` `6month` `12month`
  </Accordion>

  <Accordion title="lastfm toptags" icon="tags">
    Show your most listened genre tags with a proportional visual bar chart.

    <CodeGroup>
      ```bash Syntax theme={null}
      ~lastfm toptags [@user/username]
      ```

      ```bash Example theme={null}
      ~lastfm toptags
      ~lastfm toptags @user
      ```
    </CodeGroup>

    **Aliases:** `lfm tags`, `lfm toptags`
  </Accordion>

  <Accordion title="lastfm taste" icon="heart">
    Compare your music taste with another server member. Shows compatibility percentage and top shared artists with play count breakdowns for each user.

    <CodeGroup>
      ```bash Syntax theme={null}
      ~lastfm taste <@user>
      ```

      ```bash Example theme={null}
      ~lastfm taste @user
      ```
    </CodeGroup>

    **Aliases:** `lfm taste`
  </Accordion>

  <Accordion title="lastfm compare" icon="code-compare">
    Deep music comparison with another user. Shows compatibility, shared artist count, total scrobbles for each user, top shared artists, and artists unique to each user.

    <CodeGroup>
      ```bash Syntax theme={null}
      ~lastfm compare <@user>
      ```

      ```bash Example theme={null}
      ~lastfm compare @user
      ```
    </CodeGroup>

    **Aliases:** `lfm compare`
  </Accordion>

  <Accordion title="lastfm whoknows" icon="crown">
    See which server members have listened to a given artist the most. The top listener earns the crown.

    <CodeGroup>
      ```bash Syntax theme={null}
      ~lastfm whoknows <artist>
      ```

      ```bash Example theme={null}
      ~lastfm whoknows Kanye West
      ~lastfm whoknows Frank Ocean
      ```
    </CodeGroup>

    **Aliases:** `lfm wk`, `lfm whoknows`
  </Accordion>

  <Accordion title="lastfm whoknowstrack" icon="crown">
    See which server members have listened to a specific track the most. Use `Artist - Track` format.

    <CodeGroup>
      ```bash Syntax theme={null}
      ~lastfm whoknowstrack <Artist - Track>
      ```

      ```bash Example theme={null}
      ~lastfm whoknowstrack Kanye West - Runaway
      ```
    </CodeGroup>

    **Aliases:** `lfm wkt`, `lfm whoknowstrack`
  </Accordion>

  <Accordion title="lastfm whoknowsalbum" icon="crown">
    See which server members have listened to a specific album the most. Use `Artist - Album` format.

    <CodeGroup>
      ```bash Syntax theme={null}
      ~lastfm whoknowsalbum <Artist - Album>
      ```

      ```bash Example theme={null}
      ~lastfm whoknowsalbum Kanye West - DONDA
      ```
    </CodeGroup>

    **Aliases:** `lfm wka`, `lfm whoknowsalbum`
  </Accordion>

  <Accordion title="lastfm mostcrowns" icon="ranking-star">
    Server leaderboard showing who holds the most #1 listener spots (crowns) across all artists tracked in the server.

    <CodeGroup>
      ```bash Syntax theme={null}
      ~lastfm mostcrowns
      ```

      ```bash Example theme={null}
      ~lastfm mostcrowns
      ```
    </CodeGroup>

    **Aliases:** `lfm mc`, `lfm mostcrowns`
  </Accordion>
</AccordionGroup>

***

## Feature Overview

<CardGroup cols={2}>
  <Card title="Now Playing" icon="play">
    Real-time track display with artwork, album info, and personal play count
  </Card>

  <Card title="Top Charts" icon="chart-bar">
    Visual bar charts for top artists, tracks, and albums across any time period
  </Card>

  <Card title="Album Collage" icon="grid">
    Auto-generated grid of your top album artwork, 1×1 up to 5×5
  </Card>

  <Card title="Who Knows" icon="crown">
    Server leaderboards for artists, albums, and tracks with crown rankings
  </Card>

  <Card title="Taste Comparison" icon="heart">
    Compatibility scores and shared artist breakdowns between two users
  </Card>

  <Card title="Milestones" icon="trophy">
    Scrobble milestone tracking with ETA based on your daily average
  </Card>

  <Card title="Listening Streak" icon="fire">
    Consecutive daily listening streak tracker with today's scrobble count
  </Card>

  <Card title="Full-Size Cover" icon="image">
    Display the highest quality album artwork for your current track
  </Card>
</CardGroup>

***

## Time Periods

Most commands that fetch top data support a time period argument. The following periods are accepted:

| Argument              | Period        |
| --------------------- | ------------- |
| `overall` / `alltime` | All Time      |
| `7day` / `weekly`     | Last 7 Days   |
| `1month` / `monthly`  | Last Month    |
| `3month`              | Last 3 Months |
| `6month`              | Last 6 Months |
| `12month` / `yearly`  | Last Year     |

<Info>
  If no period is specified, commands default to `overall` (All Time), except `chart` which defaults to `7day`.
</Info>

***

## Targeting Other Users

Most commands support targeting another user in three ways:

<Tabs>
  <Tab title="Mention">
    Mention a Discord user directly. Their linked Last.fm account will be used automatically.

    ```
    ~lastfm np @user
    ~lastfm topartists @user weekly
    ```
  </Tab>

  <Tab title="Discord ID">
    Pass a raw Discord user ID (17–19 digit snowflake).

    ```
    ~lastfm profile 123456789012345678
    ```
  </Tab>

  <Tab title="Last.fm Username">
    Pass a Last.fm username directly (does not require the user to be linked).

    ```
    ~lastfm np someusername
    ~lastfm profile rj
    ```
  </Tab>
</Tabs>

***

## Album Collage

The `collage` command generates a canvas image of your top albums for a given period.

* **Grid size:** Any value from `1x1` to `5x5`. Defaults to `3x3`.
* **Period:** Accepts any standard time period argument.
* **Artwork handling:** Albums without artwork fall back to a letter placeholder on a dark background.
* **Cover fitting:** All images are scaled to fill each cell evenly with no bleed between cells.

```
~lastfm collage 4x4 weekly
~lastfm collage 5x5 @user overall
~lastfm collage 3x3 1month
```

<Note>
  Generating larger collages (e.g. 5×5) may take a moment as artwork is fetched and rendered for each cell.
</Note>

***

## Server Commands

Some commands are scoped to the current server and require members to have their Last.fm accounts linked.

<CardGroup cols={2}>
  <Card title="Who Knows" icon="crown">
    **`whoknows`**, **`whoknowstrack`**, **`whoknowsalbum`** — Ranks all linked server members by their play count for a given artist, track, or album. The top listener receives a crown.
  </Card>

  <Card title="Most Crowns" icon="ranking-star">
    **`mostcrowns`** — Compares top artist ownership across all linked members and shows a full server leaderboard of crown holders.
  </Card>
</CardGroup>

<Warning>
  Server-wide commands like `whoknows` and `mostcrowns` require fetching data for every linked member. This may take some time in larger servers.
</Warning>

***

## Command Aliases Reference

| Full Command           | Aliases                    |
| ---------------------- | -------------------------- |
| `lastfm`               | `lfm`                      |
| `lastfm np`            | `lfm np`, `lfm nowplaying` |
| `lastfm recent`        | `lfm r`                    |
| `lastfm artist`        | `lfm a`                    |
| `lastfm album`         | `lfm al`                   |
| `lastfm track`         | `lfm tr`                   |
| `lastfm collage`       | `lfm col`                  |
| `lastfm topartists`    | `lfm ta`                   |
| `lastfm toptracks`     | `lfm tt`                   |
| `lastfm topalbums`     | `lfm tab`                  |
| `lastfm profile`       | `lfm p`                    |
| `lastfm scrobbles`     | `lfm sc`                   |
| `lastfm streak`        | `lfm streak`               |
| `lastfm milestone`     | `lfm milestone`            |
| `lastfm cover`         | `lfm cover`                |
| `lastfm chart`         | `lfm chart`                |
| `lastfm taste`         | `lfm taste`                |
| `lastfm compare`       | `lfm compare`              |
| `lastfm whoknows`      | `lfm wk`                   |
| `lastfm whoknowstrack` | `lfm wkt`                  |
| `lastfm whoknowsalbum` | `lfm wka`                  |
| `lastfm mostcrowns`    | `lfm mc`                   |
| `lastfm toptags`       | `lfm tags`                 |
