Skip to main content

Botikotlin Documentation

Simplified Kotlin DSL library for interacting with the BotiCord API v3.

GitHub Repository Documentation

Installation

To get started, add the following to your build file (build.gradle/.kts or pom.xml).

For Gradle

repositories {
maven("https://jitpack.io")
}

dependencies {
implementation("com.github.boticord:botikotlin:VERSION")
}

For Maven

<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>com.github.boticord</groupId>
<artifactId>botikotlin</artifactId>
<version>VERSION</version>
</dependency>
</dependencies>

Usage

Sending Bot Statistics

Here’s an example of how to send bot statistics:

fun main() {
val token = "YOUR_BOTICORD_TOKEN_HERE"
val response = boticord(token) {
update(BOT_ID, memberCount?, shardCount?, guildCount?)
}.await()

logger.info(response)
}

Fetching User or Bot Information

You can easily retrieve information about a user or bot like this:

fun main() {
val api = boticord(token)
val response = api.fetch(USER_ID, Type.User)

logger.info(response)

// or use the DSL-style approach
val responseDsl = boticord(token) {
fetch(USER_ID, Type.Bot)
}.await()

logger.info(responseDsl)
}

For fetching server information, simply replace Type.User/Bot with Type.Server.

Receiving Notifications (e.g., bumps, comments, etc.)

To listen for notifications like bumps or comments, use the following:

boticord(token) {
notifications { event ->
logger.info("Received event: $event")
}
}.await()

If you encounter any difficulties, feel free to reach out!

If you have any difficulties with library, you can ask at Boticord Support Server.

Or just create an issue at SDK repository

Library developer: MagMigo