Discord Interaction Message

ServerAssistantAI sends a formatted Discord embed message whenever a player interacts with the AI, regardless of whether the response is public or private.

The format of the Discord interaction message is defined in the interaction-message.json file:

interaction-message.json
{
  "embeds": [
    {
      "title": "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]",
        "icon_url": "https://code-solutions.dev/assets/images/SAAI-logo.png"
      }
    }
  ]
}

This embedded 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 for displaying the player's avatar.

To customize your embed message, you can use our Embed Creator tool. This tool allows you to visually design your embed and generate the corresponding JSON code, which you can then use in your interaction-message.json file.

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.

Remember to reload ServerAssistantAI after making changes to the interaction-message.json file for the changes to take effect.

Last updated