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

# /unregister

> Unlink your AniList account from Annie Mei

## Overview

The `/unregister` command removes your linked AniList account from Annie Mei and deletes any stored OAuth credentials and session data associated with your Discord profile.

## Command syntax

```text theme={}
/unregister confirmation:<confirm|cancel>
```

## Parameters

<ParamField path="confirmation" type="string" required>
  Confirm whether to unlink your AniList account

  * `Confirm unlink` — permanently removes the link and deletes stored OAuth data
  * `Cancel` — aborts the operation with no changes
</ParamField>

## Usage examples

```text theme={}
/unregister confirmation:Confirm unlink
```

## Response messages

<ResponseField name="Unlinked">
  ```text theme={}
  Your AniList account has been unlinked from Annie Mei and your stored OAuth credentials have been deleted.
  ```

  Your OAuth credentials and any session state were successfully removed.
</ResponseField>

<ResponseField name="Not linked">
  ```text theme={}
  You do not have a linked AniList account. Run `/register` if you want to link one.
  ```

  Nothing to unlink. Use `/register` to start the linking flow.
</ResponseField>

<ResponseField name="Cancelled">
  ```text theme={}
  Cancelled. Your AniList account link was not changed.
  ```

  You chose **Cancel** — no data was deleted.
</ResponseField>

<ResponseField name="Failed">
  ```text theme={}
  I hit an internal error while unlinking your AniList account. Please try again later.
  ```

  A database or server error occurred. Retry after a short delay.
</ResponseField>

## What gets deleted

When you confirm unlinking, Annie Mei deletes the following data in a single transaction:

<CardGroup cols={2}>
  <Card title="OAuth credentials" icon="key">
    Stored AniList OAuth tokens in the auth service
  </Card>

  <Card title="OAuth sessions" icon="clock">
    Any active or expired OAuth session state, including in-flight flows that never completed
  </Card>
</CardGroup>

<Note>
  This does **not** delete your AniList account or affect your AniList data. It only removes the link between your Discord identity and Annie Mei.
</Note>

## When to use `/unregister`

* You want Annie Mei to stop showing your AniList status in server lookups
* You are switching to a different AniList account and want to clear the old link first
* You want to remove all stored OAuth credentials from Annie Mei services

After unregistering, you can run `/register` again at any time to link a new or the same AniList account.

## Source code reference

Implementation: `src/commands/unregister.rs:29`

The `register()` function defines the command structure:

```rust theme={}
pub fn register() -> CreateCommand {
    CreateCommand::new("unregister")
        .description("Unlink your AniList account from Annie Mei")
        .add_option(
            CreateCommandOption::new(
                CommandOptionType::String,
                "confirmation",
                "Confirm whether to unlink your AniList account",
            )
            .add_string_choice("Confirm unlink", "confirm")
            .add_string_choice("Cancel", "cancel")
            .required(true),
        )
}
```
