Skip to content

Commit

Permalink
Fix unsafe api usage
Browse files Browse the repository at this point in the history
  • Loading branch information
DRSchlaubi committed Apr 9, 2024
1 parent 744d55c commit 113f00f
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions samples/src/commonMain/kotlin/dev/kord/core/PingBot.kt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package dev.kord.core

import dev.kord.core.behavior.reply
import dev.kord.core.behavior.channel.PollParentChannelBehavior
import dev.kord.core.behavior.channel.createPoll
import dev.kord.core.event.message.MessageCreateEvent
import dev.kord.gateway.Intent
import dev.kord.gateway.PrivilegedIntent
import dev.kord.rest.builder.message.create.poll
import kotlin.time.Duration.Companion.minutes

suspend fun main(args: Array<String>) {
Expand All @@ -14,8 +14,7 @@ suspend fun main(args: Array<String>) {
if (message.author?.isBot == true) return@on
if (message.content == "!ping") message.channel.createMessage("pong")
if (message.content == "!poll") {
message.reply {
poll {
(message.channel as PollParentChannelBehavior).createPoll {
question("Does this work?")

answer("Yes")
Expand All @@ -25,7 +24,6 @@ suspend fun main(args: Array<String>) {
}
}
}
}

kord.login {
presence { playing("!ping to pong") }
Expand Down

0 comments on commit 113f00f

Please sign in to comment.