
High-level client for Mattermost API enabling bots/integrations to receive direct messages, detect chats, handle attachments, send messages, and split large Markdown responses.
Multiplatform Kotlin library for working with the Mattermost API. It helps you build bots and integrations that can receive direct messages, detect new chats, and send messages back to channels/users.
Coordinates (published to Maven Central):
Gradle Kotlin DSL (build.gradle.kts):
repositories {
mavenCentral()
}
dependencies {
implementation("dev.limebeck.libs:mattermost-client:1.0.0")
}
Gradle Groovy DSL (build.gradle):
repositories {
mavenCentral()
}
dependencies {
implementation 'dev.limebeck.libs:mattermost-client:1.0.0'
}
Maven (pom.xml):
<dependencies>
<dependency>
<groupId>dev.limebeck.libs</groupId>
<artifactId>mattermost-client</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
Note: This is a Kotlin Multiplatform library. Gradle will pick the right variant for your target (JVM, JS, Linux) automatically.
suspend fun main() {
val baseUrl = "https://your.mattermost.server"
val token = "MM_PERSONAL_ACCESS_TOKEN"
val client = MattermostClientImpl(baseUrl, token)
client.sendMessage(ChannelId("channel-id"), "Hello from Kotlin!")
}
Below is a real-world example that:
mattermostClient.receiveDirectMessages().collect { message ->
logger.info("<173c4c43> Processing client request ${message.userName}")
val response = gptClient.getCompletion(message.text)
response.onSuccess { r ->
mattermostClient.sendMessage(message.channelId, r.text)
}.onFailure { t ->
val requestUuid = Uuid.random().toString()
logger.error("<ea88cf0c> An error occurred while processing the request $requestUuid", t)
mattermostClient.sendMessage(
message.channelId,
"An error occurred while processing the request. Error code $requestUuid.\n${t.message}",
)
}
}
Notes:
This project is distributed under the terms specified in the LICENCE file.
Multiplatform Kotlin library for working with the Mattermost API. It helps you build bots and integrations that can receive direct messages, detect new chats, and send messages back to channels/users.
Coordinates (published to Maven Central):
Gradle Kotlin DSL (build.gradle.kts):
repositories {
mavenCentral()
}
dependencies {
implementation("dev.limebeck.libs:mattermost-client:1.0.0")
}
Gradle Groovy DSL (build.gradle):
repositories {
mavenCentral()
}
dependencies {
implementation 'dev.limebeck.libs:mattermost-client:1.0.0'
}
Maven (pom.xml):
<dependencies>
<dependency>
<groupId>dev.limebeck.libs</groupId>
<artifactId>mattermost-client</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
Note: This is a Kotlin Multiplatform library. Gradle will pick the right variant for your target (JVM, JS, Linux) automatically.
suspend fun main() {
val baseUrl = "https://your.mattermost.server"
val token = "MM_PERSONAL_ACCESS_TOKEN"
val client = MattermostClientImpl(baseUrl, token)
client.sendMessage(ChannelId("channel-id"), "Hello from Kotlin!")
}
Below is a real-world example that:
mattermostClient.receiveDirectMessages().collect { message ->
logger.info("<173c4c43> Processing client request ${message.userName}")
val response = gptClient.getCompletion(message.text)
response.onSuccess { r ->
mattermostClient.sendMessage(message.channelId, r.text)
}.onFailure { t ->
val requestUuid = Uuid.random().toString()
logger.error("<ea88cf0c> An error occurred while processing the request $requestUuid", t)
mattermostClient.sendMessage(
message.channelId,
"An error occurred while processing the request. Error code $requestUuid.\n${t.message}",
)
}
}
Notes:
This project is distributed under the terms specified in the LICENCE file.