![Kotlin](https://camo.githubusercontent.com/fcb7299b5cd547f42bed8559f4fbc9126ec837f585fe3ba3006e086959b93bcf/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4b6f746c696e2d312e392e32332d3138364643432e7376673f6c6f676f3d6b6f746c696e)
suspend fun main() {
val kord = Kord("TOKEN")
TestCommand(kord).let {
kord.registerGlobalCommand(it)
}
}
class TestCommand(kord: Kord): Command {
override val command = "test"
override val description = "Test command description"
override val options = listOf(
IntegerOption("option1", "First option").apply {
this.minValue = 0
this.maxValue = 20
this.required = true
},
StringOption("option2", "Second option").apply {
this.required = true
this.autoComplete = true
},
BooleanOption("option3", "Third option")
)
init {
onRun(kord) {
interaction.respondPublic {
embed {
this.title = "Hello, world!"
}
}
}
onAutoComplete(kord) {
interaction.suggestString {
this.choice("asdf", "asdf")
this.choice("fdsa", "fdsa")
this.choice("qwer", "qwer")
}
}
}
}
<repositories>
<repository>
<id>kr.blugon</id>
<url>https://repo.blugon.kr/repository/maven-public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>kr.blugon</groupId>
<artifactId>kordmand</artifactId>
<version>VERSION</version>
</dependency>
</dependencies>
repositories {
maven { 'https://repo.blugon.kr/repository/maven-public/' }
}
dependencies {
implementation 'kr.blugon:kordmand:VERSION'
}
repositories {
maven("https://repo.blugon.kr/repository/maven-public/")
}
dependencies {
implementation("kr.blugon:kordmand:VERSION")
}