# Interaction Messages Folder

The format of the interaction messages is defined in separate JSON files for Minecraft and Discord, located in the `interaction-messages/` directory:

* `discord-interaction-message.json`: Defines the format for Discord user interactions.
* `minecraft-interaction-message.json`: Defines the format for Minecraft player interactions.

<details>

<summary>discord-interaction-message.json</summary>

```json
{
  "embeds": [
    {
      "title": "Discord Bot Interaction",
      "color": 3447003,
      "url": "https://code-solutions.dev",
      "fields": [
        {
          "name": "User",
          "value": "[sender.asMention]",
          "inline": true
        },
        {
          "name": "Channel",
          "value": "[channel]",
          "inline": true
        },
        {
          "name": "Sent",
          "value": "[sent]",
          "inline": true
        },
        {
          "name": "User's Question",
          "value": "[message.contentDisplay] [↗]([message.jumpUrl])",
          "inline": true
        },
        {
          "name": "Bot's Response",
          "value": "[response]"
        }
      ],
      "footer": {
        "text": "ServerAssistantAI • Requester: [requester]",
        "icon_url": "https://code-solutions.dev/assets/images/SAAI-logo.png"
      },
      "thumbnail": {
        "url": "[sender.effectiveAvatarUrl]"
      }
    }
  ]
}
```

</details>

The Discord interaction message includes the user who sent the message, the channel where the interaction occurred, whether the response was sent, the user's question with a link to the original message, and the bot's response. It also includes a footer for the server name and logo, as well as the requester information (if different from the sender), and a thumbnail showing the user's avatar.

<details>

<summary>minecraft-interaction-message.json</summary>

```json
{
  "embeds": [
    {
      "title": "Minecraft Bot Interaction",
      "color": 3447003,
      "url": "https://code-solutions.dev",
      "fields": [
        {
          "name": "Player",
          "value": "[player.name]",
          "inline": true
        },
        {
          "name": "Sent",
          "value": "[sent]",
          "inline": true
        },
        {
          "name": "Type",
          "value": "[type]",
          "inline": true
        },
        {
          "name": "Player's Question",
          "value": "[question]"
        },
        {
          "name": "Bot's Response",
          "value": "[response]"
        }
      ],
      "footer": {
        "text": "ServerAssistantAI",
        "icon_url": "https://code-solutions.dev/assets/images/SAAI-logo.png"
      },
      "thumbnail": {
        "url": "https://api.creepernation.net/avatar/[player.name]"
      }
    }
  ]
}
```

</details>

The Minecraft interaction message includes the player's name, whether the response was sent, the type of interaction (public or private), the player's question, and the AI's response. It also includes a footer for the server name and logo, as well as a thumbnail displaying the player's avatar.

{% hint style="success" %}
To customize your embed message, you can use our [Embed Creator](https://embed-creator.code-solutions.dev) tool. This tool allows you to visually design your embed and generate the corresponding JSON code, which you can then use in your `discord-interaction-message.json` and `minecraft-interaction-message.json` files.
{% endhint %}

{% hint style="info" %}
To ensure that ServerAssistantAI can send interaction messages to the designated Discord channel, make sure that your bot has the "View Channel," "Send Messages," and "Embed Links" permissions in that channel.
{% endhint %}

{% hint style="warning" %}
Remember to reload ServerAssistantAI after making changes to the `interaction-messages/` files for the changes to take effect.
{% endhint %}

<div align="center" data-full-width="false"><figure><img src="https://content.gitbook.com/content/S09X1q6M99oDtbGwsA0Q/blobs/jc7kX1e5g05sXs7gdwRQ/image.png" alt=""><figcaption><p>Regular Response Message</p></figcaption></figure> <figure><img src="https://code-solutions.dev/assets/images/saai_discord2.png" alt=""><figcaption><p>Private Response Message</p></figcaption></figure></div>

<div><figure><img src="https://code-solutions.dev/assets/images/saai_discord3.png" alt=""><figcaption><p>No text related to the question found message</p></figcaption></figure> <figure><img src="https://code-solutions.dev/assets/images/saai_discord5.png" alt=""><figcaption><p>No response due to not being related to the server message</p></figcaption></figure></div>
