Interaction Messages Folder

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

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.

discord-interaction-message.json
{
  "embeds": [
    {
      "title": "Discord Bot Interaction",
      "color": 3447003,
      "url": "https://code-solutions.dev",
      "fields": [
        {
          "name": "User",
          "value": "[sender.asMention]",
          "inline": true
        },
        {
          "name": "Requester",
          "value": "[requester.asMention]",
          "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",
        "icon_url": "https://code-solutions.dev/assets/images/SAAI-logo.png"
      },
      "thumbnail": {
        "url": "[sender.effectiveAvatarUrl]"
      }
    }
  ]
}

The Discord interaction message includes the user who sent the message, the user who requested the bot's response (if different), 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 a thumbnail displaying the user's avatar.

minecraft-interaction-message.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]"
      }
    }
  ]
}

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.

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.

Regular Response Message
Private Response Message
No text related to the question found message
No response due to not being related to the server message

Was this helpful?