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

# /register

> Link or relink your AniList account for guild features

## Overview

The `/register` command starts a secure AniList OAuth flow and links your AniList account to your Discord profile.

Use this when you first connect your AniList account, or when you want to relink to a different account.

## Command syntax

```text theme={}
/register
```

This command takes no parameters.

## What happens after you run `/register`

1. Annie Mei creates a short-lived OAuth context.
2. The bot sends an ephemeral response with a `Link AniList Account` button.
3. The button opens the auth service OAuth start route in your browser.
4. After AniList authorization, Annie Mei stores your linked AniList identity.
5. You can check the linked profile with `/whoami`.

## Usage examples

```text theme={}
/register
```

You get a private message with a button that starts the OAuth flow.

## Response messages

<ResponseField name="Success">
  ```
  Click the button below to link your AniList account. This secure link is only for you and expires in about 5 minutes.

  If the page says the link expired or failed, or if you ever need to reconnect AniList later, run `/register` again in Discord.
  ```

  Includes a button labeled **Link AniList Account**.
</ResponseField>

<ResponseField name="OAuth flow unavailable">
  ```
  AniList account linking is not configured right now. Please try again later.
  ```

  Required OAuth settings are missing from the bot environment.
</ResponseField>

<ResponseField name="Flow start failed">
  ```
  I couldn't start the AniList linking flow right now. Please try again in a moment.
  ```

  Try again after a short delay.
</ResponseField>

## What changes after linking

Once linked, Annie Mei can display your AniList status in guild lookups for media in your AniList list.

<Steps>
  <Step title="Profile data stored">
    Your Discord ID is stored with your AniList user ID in the auth service.
  </Step>

  <Step title="Guild status is enabled">
    `/anime` and `/manga` show member status and score for titles in your list.
  </Step>

  <Step title="Verify your link">
    Use `/whoami` to confirm which AniList account is currently linked.
  </Step>
</Steps>

## Privacy and data storage

The auth service stores the following account-link data when linked:

<CardGroup cols={2}>
  <Card title="Discord User ID" icon="discord">
    Numeric Discord user ID
  </Card>

  <Card title="AniList User ID" icon="hashtag">
    Numeric AniList user ID
  </Card>
</CardGroup>

The auth service also stores AniList OAuth credentials (access and refresh tokens), the AniList username, and short-lived OAuth session state needed to complete and maintain the link. When you run `/whoami`, the bot displays your AniList username if available and falls back to your numeric AniList ID.

The bot does not store:

* your Discord display name
* AniList watch/read history
* raw AniList passwords or client credentials

Review the [Privacy Policy](/legal/privacy-policy) for the full data handling and deletion details.

## Unlink your AniList account

Use [`/unregister`](/commands/unregister) when you want to remove your AniList account link from Annie Mei. See the [`/unregister` documentation](/commands/unregister) for confirmation options and details on what data is deleted.

## Troubleshooting

<AccordionGroup>
  <Accordion title="Guild media output does not include my status">
    **Possible causes**

    * Registration has not finished successfully
    * The media is not in your AniList list
    * Your AniList profile privacy settings block visibility

    **Fix**

    * Run `/register` and complete the OAuth flow again
    * Verify privacy settings in AniList
  </Accordion>

  <Accordion title="My secure link expired or failed">
    **Possible causes**

    * The link is time-limited (default: around 5 minutes)
    * OAuth context became invalid before you finished authorization

    **Fix**

    * Run `/register` again to generate a new link
  </Accordion>

  <Accordion title="I want to unlink my AniList account">
    Run `/unregister confirmation:Confirm unlink` in Discord.
  </Accordion>
</AccordionGroup>

## Source code reference

Implementation: `src/commands/register/command.rs`

`register()` defines the slash command and `run()` creates the OAuth link using `AUTH_SERVICE_BASE_URL`.

The AniList browser flow is completed by the separate auth service described in [Auth service](/self-hosting/auth-service).
