Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jan-tennert/discordkm-utils


https://github.com/jan-tennert/discordkm-utils

Last synced: 10 days ago
JSON representation

Awesome Lists containing this project

README

        

# DiscordKM-Utils

DiscordKM-Utils provide some easy to use utilities like ButtonPaginators [![Maven Central](https://img.shields.io/maven-central/v/io.github.jan-tennert.discordkm/DiscordKM-Utils)](https://search.maven.org/artifact/io.github.jan-tennert.discordkm/DiscordKM-Utils)

# Example

```kotlin
val client = buildClient("token")

client.on {
if(message.content.startsWith("?paginator")) {
message.channel.sendPaginator(maxPageSize = 5) {
nextButton = nextButton.copy(label = "Next")

onPageChange { page ->
content = "hi $page"
}
}
}
}

//or in interactions
client.on {
interaction.replyPaginator(maxPageSize = 5, epheremal = true) {
nextButton = nextButton.copy(label = "Next")

onPageChange { page ->
content = "hi $page"
}
}
}

client.login()
```

# Installation

You can just install DiscordKM-Utils using:

Kotlin Dsl:

```kotlin
implementation("io.github.jan-tennert.discordkm:DiscordKM-Utils:VERSION")
```

Maven:

```xml

io.github.jan-tennert.discordkm
DiscordKM-Utils
VERSION

```

If you want a specific target add it to the artifactId like: DiscordKM-Utils-jvm and DiscordKM-Utils-js