Tomon SDK for Kotlin/Java is a maven module which provide a more convenient way for the developer to interact with the Tomon API.
- Javascript like EventEmitter for listening the specific event occurs
- Use official Tomon API
1.declare github repository in your build.gradle generate your github token with repo and readLpackages permission
You can also download jar file from release.
repositories {
maven {
url "https://maven.pkg.github.com/tomon-world/tomon-sdk-kotlin"
credentials {
username = {{Your github username}}
password = {{Your github token (read:packages, repo)}}
}
}
}
2.Install using gradle
dependencies {
implementation 'co.tomon:tomon-sdk-kotlin:1.0.2'
}
1.Initialise your bot.
Bot bot = new Bot();
2.start your bot by using your account or bot token which generated by Bot Master
bot.startWithPassward("name#0000", "password");
// or using token
bot.start("token")
3.you can listen to gateway or dispatched event
bot.on("DISPATCH", Main::pic);
bot.on("MESSAGE_CREATE",Main::speak)
For more examples, please refer to the example
Please read the Documentation for more detail