# Discord Login

Source: https://docs.scrappey.com/docs/discord-login

> Automatically authenticate with Discord using a valid authorization token by injecting it into the browser session.

## Command

`"discord_login"`

This action logs into Discord by injecting an authorization token into the browser session. Use it to skip the login page and access authenticated areas directly.

## Parameters

| Parameter | Type   | Required | Description                                                                          |
| --------- | ------ | -------- | ------------------------------------------------------------------------------------ |
| `token`   | string | Yes      | Your Discord authorization token. Required for login.                                |
| `wait`    | number | No       | Time in seconds to wait after logging in. Helpful for letting Discord fully load.    |
| `when`    | string | No       | Run the action `beforeload` or `afterload`. Default is `afterload`.                  |

## Example

```bash
curl -X POST "https://publisher.scrappey.com/api/v1?key=YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "cmd": "request.get",
    "url": "https://discord.com",
    "browserActions": [
      {
        "type": "discord_login",
        "token": "YOUR_DISCORD_AUTH_TOKEN",
        "wait": 5
      }
    ]
  }'
```

## Notes

Using Discord tokens for automation is against Discord's Terms of Service. Only use this feature on accounts you own and control, and for ethical automation purposes.

Use case ideas:

* Access a Discord server's dashboard to scrape settings or user data.
* Automatically navigate to specific pages inside Discord after login.
* Pre-authenticate before submitting bot commands or forms.

Tips:

* Always wait a few seconds (`wait: 5`) to allow the Discord client to fully render after login.
* Combine with `goto`, `click`, or `execute_js` to interact with Discord's interface post-login.
