# HibiscusMC Discord Link

### Info

* **Version**: 1.19.2
* **How it works**: Some of the players were having a hard time linking their accounts through DiscordSRV's default system which requires to send a verification received in-game to the Discord bot and the client wanted to use Discord's OAuth2 protocol. The plugin creates a temporarily link when the `/discord link` command is used, and once the player completes the authentication they are added to the Discord server and the accounts are linked.&#x20;

### Images

{% embed url="<https://youtu.be/amL0Yw9u7So>" %}

### Files

{% code title="config.yml" lineNumbers="true" %}

```yaml
discord:
  application:
    id: 123
    secret: abc
  #
  # The token is required in order to be able to add the user to the server
  #
  botToken: xyz # Required to add the user to the server
  guildId: 123
  oauth:
    #
    # https://discord.com/developers/docs/topics/oauth2#shared-resources-oauth2-scopes
    #
    scope: identify guilds.join

web:
  port: 3030
  #
  # The host also needs to be added on the Discord app dashboard as redirect
  #
  host: https://discordlink.hibiscusmc.com

messages:
  alreadyLinked: '<red>Your account is already linked to a Discord account (id: <id>)'
  authMessage: '<green><click:open_url:"{url}">Click to open the Discord Auth page</click>'
```

{% endcode %}


---

# 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://portfolio.gabytm.me/plugins/commissions/hibiscusmc-discord-link.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.
