ServerAssistantAI
WebsitePurchaseDiscord
1.3.2
1.3.2
  • 🤖ServerAssistantAI
    • Showcase
    • Features
    • Test Server
  • ⭐Getting Started
    • How ServerAssistantAI Works
    • Prerequisites
    • Installation
    • Commands & Permissions
    • Addons
  • 🛠️Configuration
    • The Basics
    • Config YAML File
    • Credentials YAML File
    • Minecraft Config Folder
    • Discord Config Folder
    • Documents Folder
    • Interaction Messages Folder
    • Messages YAML File
  • 🤖Providers & Models
    • AI Providers
      • Configuring Providers
      • Embedding Provider Options
      • Chat (LLM) Provider Options
      • Question Detection Provider Options
    • Recommended Models
    • Free Models
    • Paid Models
  • 🆘FAQs & Support
    • FAQs
    • Official Support
    • Troubleshooting
  • 💻Developers
    • API
Powered by GitBook
On this page
  • JavaDoc
  • API Version
  • Integrating with our API:
  • Events:
  • PreDiscordHandleEvent:
  • PostDiscordHandleEvent:
  • PreMinecraftHandleEvent:
  • PostMinecraftHandleEvent:

Was this helpful?

  1. Developers

API

ServerAssistantAI provides a powerful API for developers to integrate the AI assistant's functionality into their own plugins or applications, as well as create Addons for ServerAssistantAI.

PreviousTroubleshooting

Was this helpful?

The API is subject to change in future versions as we improve ServerAssistantAI and may result in breakages. You can join our server to make sure you're notified when a breaking change is done/will be done to ServerAssistantAI, so you can update your addons accordingly.

JavaDoc

Please check the links to ensure you are working with the desired version. The badges below display the latest versions.

API Version

Integrating with our API:

To integrate with the ServerAssistantAI API, simply add the necessary repository and dependency to your build configuration. For Maven users, update your pom.xml file, and for Gradle users, modify your build.gradle/build.gradle.kts file.

Replace VERSION with the API version you would like. The badges above display the latest versions available.

Additionally, ServerAssistantAI should load before your plugin by specifying this in the plugin.yml: softdepend: [ServerAssistantAI]

<repository>
    <id>bluetree242-repo</id>
    <url>https://repo.bluetree242.dev/public</url>
</repository>
<dependency>
    <groupId>dev.bluetree242.serverassistantai</groupId>
    <artifactId>api</artifactId>
    <version>VERSION</version>
    <scope>provided</scope>
</dependency>
repositories {
    maven { url 'https://repo.bluetree242.dev/public' }
    // Other repositories..
}
dependencies {
    compileOnly 'dev.bluetree242.serverassistantai:api:VERSION'
    // Other dependencies..
}
repositories {
    maven("https://repo.bluetree242.dev/public")
    // Other repositories..
}
dependencies {
    compileOnly("dev.bluetree242.serverassistantai:api:VERSION")
    // Other dependencies..
}

You must also copy the repository from the repositories section from either of the other gradle sections according to what you use. You must add libs.serverassistantai in your dependencies section. (compileOnly)

[versions]
serverassistantai = "VERSION"
# Other versions..

[libraries]
serverassistantai = { group = "dev.bluetree242.serverassistantai", name = "api", version.ref = "serverassistantai" }
# Other dependencies..

ServerAssistantAI's API is public and accessible to all developers, even if they haven't purchased the plugin. As long as you obtain the plugin's JAR file legally, such as receiving it from someone for testing purposes, you can receive support for our API. However, using pirated or illegally obtained versions of ServerAssistantAI will not be eligible for support.

Events:

ServerAssistantAI API includes four events that can be used to interact with the AI assistant's functionality and customize its behavior.

PreDiscordHandleEvent:

This allows you to cancel the event, preventing the bot from responding to the message or sending typing indicators. You can also access the user, message, event, and history associated with the question.

PostDiscordHandleEvent:

This event provides access to the user, message, event, history, reply message, response, response text, and information used to generate the response. It allows you to perform custom actions or logging based on the bot's response.

PreMinecraftHandleEvent:

This event allows you to cancel the question-handling process, preventing the bot from responding to the player's message. You can access the player, message, and whether the question was forced.

PostMinecraftHandleEvent:

This event provides access to the player, message, whether the question was forced, response, response text, whether the response was private, and information used to generate the response. It allows you to perform custom actions or logging based on the bot's interaction with the player.

The is fired before the bot handles a question on Discord.

The is fired after the bot has finished handling a question on Discord.

The is fired before the bot handles an in-game question, either through chat or the /serverassistantai ask command.

The is fired after the bot has finished handling an in-game question.

💻
PreDiscordHandleEvent
PostDiscordHandleEvent
PreMinecraftHandleEvent
PostMinecraftHandleEvent
discord