Kdaw(Kotlin Discord Api Wrapper) is a lightweight Discord API wrapper written in Kotlin. It can run even large scale bots stably.
0.*.*
), and the API will be changed or removed
without notice.
fun main() {
Kdaw.create("<< insert bot token here >>") {
listen<ServerMessageCreateEvent>(priority = 1) {
println("[Message] ${it.server} | ${it.channel} | ${it.user} | ${it.text}")
}
listen(BasicListener)
}
}
object BasicListener {
@EventTarget
fun ready(event: ReadyEvent) {
println("Hello~~!")
}
@EventTarget(priority = 5)
suspend fun message(event: ServerMessageCreateEvent) {
event.reply("hi!")
}
}
Replace <version>
with the version you want to use of jitpack.
Gradle Kotlin DSL
repositories {
maven("https://jitpack.io")
}
dependencies {
implementation("com.github.Kotlin-Chan:kdaw:<version>")
}
Gradle
repositories {
maven { url "https://jitpack.io" }
}
dependencies {
implementation "com.github.Kotlin-Chan:kdaw:<version>"
}
Maven
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependency>
<groupId>com.github.Kotlin-Chan</groupId>
<artifactId>kdaw</artifactId>
<version>version</version>
</dependency>