A low-level implementation of discord's rest api.
suspend fun main(args: Array<String>) {
val token = args.firstOrNull() ?: error("token required")
val rest = RestClient(KtorRequestHandler(token))
val username = rest.user.getCurrentUser().username
println("using $username's token")
}
Replace {version}
with the latest version number on maven central.
For Snapshots replace {version}
with {branch}-SNAPSHOT
e.g: 0.7.x-SNAPSHOT
repositories {
mavenCentral()
// Kord Snapshots Repository (Optional):
maven("https://oss.sonatype.org/content/repositories/snapshots")
}
dependencies {
implementation("dev.kord:kord-rest:{version}")
}
repositories {
mavenCentral()
// Kord Snapshots Repository (Optional):
maven("https://oss.sonatype.org/content/repositories/snapshots")
}
dependencies {
implementation("dev.kord:kord-rest:{version}")
}
<repository>
<id>snapshots-repo</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<dependency>
<groupId>dev.kord</groupId>
<artifactId>kord-rest-jvm</artifactId>
<version>{version}</version>
</dependency>