I have just setup a new Kotlin project in Intellij I implemented the code as shown in the "Making a simple ping-pong bot" section of the github wiki, adding my own token
suspend fun main() { val kord = Kord("MY TOKEN") kord.on<MessageCreateEvent> { // runs every time a message is created that our bot can read // ignore other bots, even ourselves. We only serve humans here! if (message.author?.isBot != false) return@on // check if our command is being invoked if (message.content != "!ping") return@on // all clear, give them the pong! message.channel.createMessage("pong!") } kord.login { // we need to specify this to receive the content of messages @OptIn(PrivilegedIntent::class) intents += Intent.MessageContent }}
suspend fun main() { val kord = Kord("MY TOKEN") kord.on<MessageCreateEvent> { // runs every time a message is created that our bot can read // ignore other bots, even ourselves. We only serve humans here! if (message.author?.isBot != false) return@on // check if our command is being invoked if (message.content != "!ping") return@on // all clear, give them the pong! message.channel.createMessage("pong!") } kord.login { // we need to specify this to receive the content of messages @OptIn(PrivilegedIntent::class) intents += Intent.MessageContent }}