# 💬 Discord

Discord integrations can be used for staff logs, reports, donation notifications, HelpOp tickets, and advanced HelpOp workflows.

***

### Integration Types

NexusProxy can use Discord in two main ways:

| Type              | Description                                                                                    |
| ----------------- | ---------------------------------------------------------------------------------------------- |
| Discord Webhooks  | Simple Discord logging and notifications using webhook URLs.                                   |
| Discord Bot / JDA | Advanced HelpOp bot mode with buttons, ticket threads, Discord replies, and ticket management. |

{% hint style="info" %}
Webhook mode is simpler.

Bot mode is more advanced and is mainly used by the HelpOp module.
{% endhint %}

***

### What Discord Can Be Used For

Discord integrations can be used by several NexusProxy modules.

| Module    | Discord Usage                                                                            |
| --------- | ---------------------------------------------------------------------------------------- |
| Staff     | Staff chat logs, admin chat logs, donor chat logs, staff join logs, and staff quit logs. |
| Report    | Sends submitted reports to a Discord webhook.                                            |
| Donations | Sends donation messages or embeds to a Discord webhook.                                  |
| HelpOp    | Supports webhook mode and advanced bot mode.                                             |

***

### Discord Webhooks

Discord webhooks are the easiest way to send messages from NexusProxy to Discord.

Webhook mode can be used for:

* Staff chat logs
* Staff join and quit logs
* Report notifications
* Donation logs
* HelpOp requests
* Simple support logs

Webhook mode usually only requires a Discord webhook URL.

***

### Creating a Discord Webhook

To create a Discord webhook:

1. Open your Discord server.
2. Go to the channel where messages should be sent.
3. Open **Edit Channel**.
4. Go to **Integrations**.
5. Select **Webhooks**.
6. Create a new webhook.
7. Copy the webhook URL.
8. Paste it into the related NexusProxy module configuration.

{% hint style="warning" %}
Keep webhook URLs private.

Anyone with the webhook URL may be able to send messages to that Discord channel.
{% endhint %}

***

### Example Webhook Configuration

Example concept:

```yaml
discord:
  webhook:
    enabled: true
    url: "https://discord.com/api/webhooks/..."
```

The exact format depends on the module configuration file.

Check the related module file before editing:

```
plugins/NexusProxy/modules/staff/staff.yml
plugins/NexusProxy/modules/report/report.yml
plugins/NexusProxy/modules/donations/donations.yml
plugins/NexusProxy/modules/helpop/helpop.yml
```

***

### Staff Discord Logs

The Staff module can optionally send staff-related messages to Discord.

This may include:

* Staff chat messages
* Admin chat messages
* Donor chat messages
* Staff join messages
* Staff quit messages

Example use cases:

* Staff moderation logs
* Admin activity channels
* Staff communication archive
* Monitoring staff availability

{% hint style="info" %}
Staff Discord logging is configured inside `staff.yml`.
{% endhint %}

***

### Report Discord Logs

The Report module can send submitted player reports to Discord.

This is useful for:

* Offline staff notifications
* Moderation logs
* Report tracking
* Staff Discord channels

Example concept:

```yaml
discord:
  enabled: true
  webhook_url: "https://discord.com/api/webhooks/..."
```

{% hint style="info" %}
Report Discord logging is configured inside `report.yml`.
{% endhint %}

***

### Donations Discord Logs

The Donations module can send donation notifications to Discord.

This is useful for:

* Store purchase logs
* Donation announcements
* Supporter notifications
* Staff donation tracking
* Public donation channels

Example concept:

```yaml
discord:
  enabled: true
  webhook_url: "https://discord.com/api/webhooks/..."
```

{% hint style="info" %}
Donation Discord logging is configured inside `donations.yml`.
{% endhint %}

***

### HelpOp Webhook Mode

HelpOp webhook mode sends HelpOp requests to Discord through a webhook.

This is the simpler HelpOp Discord setup.

It is useful if you want:

* HelpOp messages in Discord
* Support logs
* Staff visibility
* Simple ticket notifications

Webhook mode usually requires only a webhook URL.

Example concept:

```yaml
discord:
  webhook:
    enabled: true
    url: "https://discord.com/api/webhooks/..."
```

***

### HelpOp Bot Mode

HelpOp bot mode is the advanced Discord integration.

It can support features such as:

* Discord buttons
* Ticket threads
* Replies from Discord
* Override handling
* Ticket deletion
* More interactive support workflows

Bot mode uses JDA runtime libraries.

NexusProxy downloads the required libraries into:

```
plugins/NexusProxy/libraries/
```

{% hint style="info" %}
A separate JDA addon jar is not required.

The JDA bridge is handled by NexusProxy.
{% endhint %}

***

### Bot Mode Requirements

HelpOp bot mode may require:

* Discord bot token
* Log channel ID
* Ticket channel ID
* Discord server permissions
* Thread permissions
* Message permissions
* JDA runtime libraries
* Internet access from the proxy to Discord

Example concept:

```yaml
discord:
  bot:
    enabled: true
    token: "YOUR_BOT_TOKEN"
    log_channel_id: "123456789012345678"
```

{% hint style="danger" %}
Never share your Discord bot token publicly.

If your token is leaked, regenerate it immediately from the Discord Developer Portal.
{% endhint %}

***

### Discord Bot Permissions

For HelpOp bot mode, the Discord bot may need permissions such as:

* View Channels
* Send Messages
* Embed Links
* Read Message History
* Create Public Threads
* Create Private Threads
* Send Messages in Threads
* Manage Threads
* Manage Messages, if ticket deletion or cleanup is enabled

{% hint style="warning" %}
The exact permissions depend on your HelpOp bot mode configuration.
{% endhint %}

***

### Runtime Libraries

NexusProxy downloads optional runtime libraries when needed.

For Discord bot mode, this includes JDA-related libraries.

Libraries are stored in:

```
plugins/NexusProxy/libraries/
```

{% hint style="info" %}
You normally do not need to manually install JDA libraries.

NexusProxy handles them when bot mode is enabled.
{% endhint %}

***

### Common Use Cases

#### Send reports to Discord

Configure the Report module webhook in:

```
plugins/NexusProxy/modules/report/report.yml
```

***

#### Send donation logs to Discord

Configure the Donations module webhook in:

```
plugins/NexusProxy/modules/donations/donations.yml
```

***

#### Send staff logs to Discord

Configure the Staff module webhook in:

```
plugins/NexusProxy/modules/staff/staff.yml
```

***

#### Use HelpOp webhook mode

Configure HelpOp webhook settings in:

```
plugins/NexusProxy/modules/helpop/helpop.yml
```

***

#### Use HelpOp bot mode

Configure HelpOp bot settings in:

```
plugins/NexusProxy/modules/helpop/helpop.yml
```

***

### Webhook Mode vs Bot Mode

| Feature                | Webhook Mode | Bot Mode                        |
| ---------------------- | ------------ | ------------------------------- |
| Easy setup             | Yes          | No                              |
| Requires bot token     | No           | Yes                             |
| Sends Discord messages | Yes          | Yes                             |
| Discord buttons        | No           | Yes                             |
| Ticket threads         | No           | Yes                             |
| Replies from Discord   | No           | Yes                             |
| Ticket deletion        | No           | Yes, depending on configuration |
| Best for               | Simple logs  | Advanced HelpOp workflows       |

***

### Setup Tips

* Use webhook mode for simple logs.
* Use bot mode only if you need advanced HelpOp features.
* Keep webhook URLs private.
* Keep bot tokens private.
* Make sure the proxy can connect to Discord.
* Make sure the bot has the required Discord permissions.
* Check `plugins/NexusProxy/libraries/` if bot mode cannot load JDA libraries.
* Restart the proxy after enabling Discord bot mode.
* Test Discord output before using it in production.
* Use separate Discord channels for reports, donations, staff logs, and HelpOp if possible.

***

### Common Issues

#### Discord webhook messages do not send

Check that:

* The webhook URL is correct.
* The webhook still exists in Discord.
* Webhook integration is enabled in the module configuration.
* The proxy can reach Discord.
* The Discord channel still exists.
* The module event is actually being triggered.

***

#### Webhook URL is invalid

Check that:

* The URL was copied completely.
* There are no extra spaces.
* The webhook was not deleted.
* The webhook belongs to the correct Discord channel.

***

#### HelpOp bot does not connect

Check that:

* Bot mode is enabled.
* The bot token is correct.
* The bot is invited to the Discord server.
* The bot has access to the configured channel.
* The configured channel ID is correct.
* The proxy can connect to Discord.
* JDA runtime libraries were downloaded into `plugins/NexusProxy/libraries/`.

***

#### Bot mode loads but buttons do not work

Check that:

* Button support is enabled in the HelpOp configuration.
* The bot has permission to send messages and use components.
* The configured channel or thread exists.
* The ticket was not deleted or closed.
* There are no Discord permission restrictions blocking interaction handling.

***

#### Ticket threads are not created

Check that:

* Thread support is enabled.
* The bot has permission to create threads.
* The target channel supports threads.
* The configured channel ID is correct.
* The bot can view and send messages in the channel.

***

#### Replies from Discord do not appear in-game

Check that:

* Bot mode is enabled.
* Discord reply handling is enabled.
* The ticket is still active.
* The bot has access to the thread or channel.
* The in-game player is online if required by your configuration.
* The proxy console does not show Discord or JDA errors.

***

#### JDA libraries do not download

Check that:

* The proxy has internet access.
* The proxy can write to `plugins/NexusProxy/libraries/`.
* Bot mode is enabled.
* The proxy was restarted after enabling bot mode.
* File permissions allow NexusProxy to create and load libraries.

***

### Security Tips

* Never publish webhook URLs.
* Never publish bot tokens.
* Regenerate leaked bot tokens immediately.
* Use separate webhooks for different modules.
* Avoid giving the Discord bot Administrator permission unless you fully trust the setup.
* Give the bot only the permissions it needs.
* Do not paste full configs into public support chats without removing secrets.

***

### Summary

Discord integrations allow NexusProxy to send staff logs, reports, donation notifications, and HelpOp tickets to Discord.

Use webhooks for simple notifications and HelpOp bot mode for advanced ticket workflows with buttons, threads, and Discord replies.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://nexusproxy.nemesismc.net/integrations/discord.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
