
Offers utilities for creating interactive paginators with customizable buttons in messaging and interactions, enhancing user experience with dynamic content updates in chat applications.
DiscordKM-Utils provide some easy to use utilities like ButtonPaginators
val client = buildClient("token")
client.on<MessageCreateEvent> {
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<SlashCommand> {
interaction.replyPaginator(maxPageSize = 5, epheremal = true) {
nextButton = nextButton.copy(label = "Next")
onPageChange { page ->
content = "hi $page"
}
}
}
client.login()You can just install DiscordKM-Utils using:
Kotlin Dsl:
implementation("io.github.jan-tennert.discordkm:DiscordKM-Utils:VERSION")Maven:
<dependency>
<groupId>io.github.jan-tennert.discordkm</groupId>
<artifactId>DiscordKM-Utils</artifactId>
<version>VERSION</version>
</dependency>If you want a specific target add it to the artifactId like: DiscordKM-Utils-jvm and DiscordKM-Utils-js
DiscordKM-Utils provide some easy to use utilities like ButtonPaginators
val client = buildClient("token")
client.on<MessageCreateEvent> {
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<SlashCommand> {
interaction.replyPaginator(maxPageSize = 5, epheremal = true) {
nextButton = nextButton.copy(label = "Next")
onPageChange { page ->
content = "hi $page"
}
}
}
client.login()You can just install DiscordKM-Utils using:
Kotlin Dsl:
implementation("io.github.jan-tennert.discordkm:DiscordKM-Utils:VERSION")Maven:
<dependency>
<groupId>io.github.jan-tennert.discordkm</groupId>
<artifactId>DiscordKM-Utils</artifactId>
<version>VERSION</version>
</dependency>If you want a specific target add it to the artifactId like: DiscordKM-Utils-jvm and DiscordKM-Utils-js