# Link your account

Source: https://righteousbot.dev/docs/lastfm/overview/

Link your Last.fm account, then post what you're playing, rank your server and read your stats.

Righteous turns your Last.fm account into now-playing cards, server leaderboards, charts and stats.
Almost everything is a subcommand of [`,lastfm`](/commands/lastfm/lastfm/#lastfm) (default prefix `,`,
alias `,lf`), or `/lastfm` on slash. Link an account first: nothing works without one.

## Log in with Last.fm [#log-in-with-lastfm]

Logging in proves the account is yours. Run [`,lastfm set`](/commands/lastfm/lastfm/#lastfm-set) with no
username (or `,lastfm login`). On slash, run `/lastfm set` and leave `username` empty.

<CommandBlock syntax=",lastfm set" />

<Steps>
  <Step title="Open the card in your DMs">
    Righteous DMs you a **Link your Last.fm account** card. The channel only sees "Check your DMs".
  </Step>

  <Step title="Approve Righteous">
    The link opens righteousbot.dev, asks you to confirm you started this, then sends you to Last.fm.
  </Step>

  <Step title="Come back to Discord">
    Righteous DMs you that you're linked, with a ✓. There's no code to copy back.
  </Step>
</Steps>

The link works **once** and expires after **10 minutes**. A new login replaces the old card. If your
DMs are closed, `/lastfm set` shows the card to you alone; the prefix command asks you to open them.
Righteous only ever **reads** your account. It can't scrobble, love tracks or change anything.

<Callout type="warn" title="Never use someone else's login link">
  Whoever approves a link connects *their* Last.fm to *your* Discord. Close any link you didn't start.
</Callout>

## Or type your username [#or-type-your-username]

Quicker, but it's a claim: Righteous checks the name exists, not that it's yours.

<CommandBlock syntax=",lastfm set <username>" example=",lastfm set streets" />

* Use your Last.fm **username** (the one in your profile URL), not your email. The account needs at
  least one scrobble.
* On slash, fill in `username` **or** turn on `login`, not both.
* Retyping the name you're verified as keeps the ✓. A **different** name drops it.
* If the name is already linked to other Discord accounts, you get a warning. The link still works.

Linking pulls in your top artists, albums and tracks, with a counter on big accounts. Then play
something and post your [now-playing card](/docs/lastfm/now-playing/) with `,np`.

<Callout type="warn" title="Linking a different username deletes your stored history">
  The old plays belong to someone else, so they're deleted, not merged. Re-linking the same name is safe.
</Callout>

## Keep your listening private [#keep-your-listening-private]

If you hide your recent listening on Last.fm and you **logged in**, your own [`,np`](/commands/lastfm/np/#np),
[`,lastfm recent`](/commands/lastfm/lastfm/#lastfm-recent), [`,lastfm streaks`](/commands/lastfm/lastfm/#lastfm-streaks)
and [history sync](/docs/lastfm/history/) still work. Everyone else (`,np @you`, the server digest) sees
"*name*'s Last.fm listening is private."

Linked by typing a username? Your own commands will ask you to log in with `/lastfm set`. If you remove
Righteous on Last.fm later, you keep the link but lose the ✓, and need to log in again.

## Check which premium you need [#check-which-premium-you-need]

| Tier                 | Costs | Covers                   |
| -------------------- | ----- | ------------------------ |
| **Boosting Premium** | Free  | Boost the support server |
| **Self Premium**     | Paid  | You, in every server     |
| **Server Premium**   | Paid  | Everyone in one server   |

Each page marks what needs premium. Two rules decide it:

* **"Any premium"** features open with any of the three, boosting included.
* **"Self Premium"** features need a purchase. Boosting never opens them.

Your own paid settings always beat a server's defaults. Pricing is on [/premium](/premium/).

## Know where your numbers come from [#know-where-your-numbers-come-from]

`,np` and `recent` ask Last.fm live. Play counts, WhoKnows and crowns read your **stored library**, which
can lag until you run [`,lastfm update`](/commands/lastfm/lastfm/#lastfm-update). Anything about dates
needs a [history sync](/docs/lastfm/history/).

## Where next [#where-next]

<Cards>
  <Card title="Now playing" href="/docs/lastfm/now-playing/" description="Post your card and make it your own." />

  <Card title="WhoKnows and crowns" href="/docs/lastfm/who-knows/" description="Rank the server for an artist." />

  <Card title="Friends" href="/docs/lastfm/friends/" description="Ask who-knows of people you know." />

  <Card title="Charts and stats" href="/docs/lastfm/charts/" description="Collages, top lists and breakdowns." />

  <Card title="History sync" href="/docs/lastfm/history/" description="Date questions, recaps and exports." />

  <Card title="Your settings" href="/docs/lastfm/your-settings/" description="The panel, refreshing, and unlinking." />

  <Card title="Server settings" href="/docs/lastfm/server-settings/" description="House style and the digest." />
</Cards>

## Common issues [#common-issues]

**"Invalid LastFM."** No account is linked. Run [`,lastfm set`](/commands/lastfm/lastfm/#lastfm-set).

**Setting the username failed.** Check the spelling against your profile URL, and that the account
has at least one scrobble.

**No login card arrived.** Your DMs are closed. Open them, or use `/lastfm set`.

**The login link expired.** It lasts 10 minutes and works once. Run `,lastfm set` again.

**"Your Last.fm listening is private."** Log in with `,lastfm set` so your own commands can read it.
