# Discord

<figure><img src="/files/yBVgcPbpqT9nBpkcVQCa" alt=""><figcaption></figcaption></figure>

<div><figure><img src="/files/ubhbeEPHHlSE2WBu0FYV" alt=""><figcaption></figcaption></figure> <figure><img src="/files/EjQ9jTySjr81767c4uib" alt=""><figcaption></figcaption></figure></div>

{% code fullWidth="true" %}

```yaml
########################################################################################################################
#
# ██████╗░██╗░██████╗░█████╗░░█████╗░██████╗░██████╗░
# ██╔══██╗██║██╔════╝██╔══██╗██╔══██╗██╔══██╗██╔══██╗
# ██║░░██║██║╚█████╗░██║░░╚═╝██║░░██║██████╔╝██║░░██║
# ██║░░██║██║░╚═══██╗██║░░██╗██║░░██║██╔══██╗██║░░██║
# ██████╔╝██║██████╔╝╚█████╔╝╚█████╔╝██║░░██║██████╔╝
# ╚═════╝░╚═╝╚═════╝░░╚════╝░░╚════╝░╚═╝░░╚═╝╚═════╝░
#
# This module allows you to display information about your discord through a webhook, more information here:
# https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks
#
# You must define the URL of the webhook and the type of logo display
#
########################################################################################################################

enable: true

# Send the player’s message on your discord
chat-message:
  enable: false # Enable or not the webhook
  webhook: "https://discord.com/api/webhooks/"
  avatar: "https://mc-heads.net/avatar/%uuid%"
  message: "%message%"
  username: "%player%"

# Send a message when a player logs in
join-message:
  enable: false # Enable or not the webhook
  webhook: "https://discord.com/api/webhooks/"
  embeds:
    - author:
        name: "%player% just logged in"
        icon-url: "https://mc-heads.net/head/%uuid%"
      color: "#00ff00" # Sets the color of the embed

# Send a message when a player logs out
left-message:
  enable: false # Enable or not the webhook
  webhook: "https://discord.com/api/webhooks/"
  embeds:
    - author:
        name: "%player% just logged out"
        icon-url: "https://mc-heads.net/head/%uuid%"
      color: "#ff0000" # Sets the color of the embed

# Sends a message when the player first logs in
first-join-message:
  enable: false # Enable or not the webhook
  webhook: "https://discord.com/api/webhooks/"
  embeds:
    - author:
        name: "%player% just logged in for the first time"
        icon-url: "https://mc-heads.net/head/%uuid%"
      color: "#44ff44" # Sets the color of the embed
      
enable-link-account: false

log-link-error-message:
  enable: false # Enable or not the webhook
  webhook: "https://discord.com/api/webhooks/"
  message: "%player% vient d'essayer de lier son compte avec le code `%code%`"

log-link-success-message:
  enable: false # Enable or not the webhook
  webhook: "https://discord.com/api/webhooks/"
  message: "%player% vient de lier son compte avec le code `%code%` (%discord-name%:%discord-id%)"

log-unlink-message:
  enable: false # Enable or not the webhook
  webhook: "https://discord.com/api/webhooks/"
  message: "%player% vient de délier son compte (%discord-name%:%discord-id%)"      
```

{% endcode %}

## Discord Bot

The bot allows you to link a minecraft account to a discord account

To set the link message you must make the command `/setlinkmessage`

{% code fullWidth="true" %}

```yaml
# Se bot discord is not a minecraft plugin!

# The token of your Discord Bot
bot-token: "DISCORD-TOKEN"

# The guild ID of your Discord Server
guild-id: 511516467615760405

database-configuration:
  # The prefix that will be applied to all tables, if you have several plugins with the same database you must have one.
  # It is advisable not to change this value
  tablePrefix: "zessentials_"
  # IP Address of the machine the database is hosted on
  host: 192.168.10.10
  # Port of the database, by default, MYSQL's port is 3306
  port: 3306
  # Database username
  user: homestead
  # Database password
  password: 'secret'
  # Database
  database: zessentials
  # Enable of not the SQL debug mode
  debug: false

link:

  enable: true

  # Allows logs of actions performed by a user
  log:
    channel: 1324025378142163025
    create: "**%name%** (%id%) has just created the code `%code%`."
    ask: "**%name%** (%id%) has just requested the code `%code%`."

  # Message sent when user interacts with the message
  messages:
    code: "Use the command `/link %code%` to link your account."
    already: "Your account is already linked."

  # Button that the player will have to interact to link his account
  button:
    name: "Click to link your account"
    style: SUCCESS
    emoji: "U+2795" # The emoji that will be displayed on the button

  embed:
    title:
      title: "Link my account"
      # url: "https://zessentials.net" # The URL of the title
    description: "To link your account, follow these steps:\n1. Click the button above.\n2. Run the command in-game to complete the linking of your account."
    color:
      r: 10
      g: 150
      b: 10
      alpha: 255 # The alpha value of the color (optional)
    footer:
      text: "zEssentials - 2025"
      # iconUrl: "https://groupez.dev/storage/images/users/0/0/0/1.png" # Optional
    # thumbnail:
      # url: "https://groupez.dev/storage/images/users/0/0/0/1.png"
    # image:
      # url: "https://example.com/image.png"
    # author:
      # name: "Author Name"
      # url: "https://authorwebsite.net" # Optional
      # iconUrl: "https://groupez.dev/storage/images/users/0/0/0/1.png"
```

{% 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://zessentials.groupez.dev/modules/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.
