Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jan-tennert/discordkm-utils
https://github.com/jan-tennert/discordkm-utils
Last synced: 10 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/jan-tennert/discordkm-utils
- Owner: jan-tennert
- Created: 2021-10-08T17:12:29.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-10-08T18:03:13.000Z (over 3 years ago)
- Last Synced: 2024-11-08T04:05:32.390Z (2 months ago)
- Language: Kotlin
- Size: 67.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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