diff --git a/core/src/main/kotlin/Unsafe.kt b/core/src/main/kotlin/Unsafe.kt index b09c1e206ba3..c949920656d5 100644 --- a/core/src/main/kotlin/Unsafe.kt +++ b/core/src/main/kotlin/Unsafe.kt @@ -68,6 +68,10 @@ class Unsafe(private val kord: Kord) { fun webhook(id: Snowflake): WebhookBehavior = WebhookBehavior(id, kord) + fun stageInstance(id: Snowflake, channelId: Snowflake): StageInstanceBehavior = StageInstanceBehavior( + id, channelId, kord, kord.defaultSupplier + ) + override fun toString(): String { return "Unsafe" } @@ -87,5 +91,4 @@ class Unsafe(private val kord: Kord) { ): GlobalApplicationCommandBehavior = GlobalApplicationCommandBehavior(applicationId, commandId, service) - } \ No newline at end of file diff --git a/core/src/main/kotlin/behavior/channel/StageChannelBehavior.kt b/core/src/main/kotlin/behavior/channel/StageChannelBehavior.kt index 6a01603a989e..85f818b6c29d 100644 --- a/core/src/main/kotlin/behavior/channel/StageChannelBehavior.kt +++ b/core/src/main/kotlin/behavior/channel/StageChannelBehavior.kt @@ -3,7 +3,6 @@ package dev.kord.core.behavior.channel import dev.kord.common.entity.Snowflake import dev.kord.core.Kord import dev.kord.core.cache.data.ChannelData -import dev.kord.core.entity.channel.VoiceChannel import dev.kord.core.cache.data.StageInstanceData import dev.kord.core.entity.StageInstance import dev.kord.core.entity.channel.Channel @@ -33,6 +32,7 @@ interface StageChannelBehavior : BaseVoiceChannelBehavior { return StageChannelBehavior(id, guildId, kord, strategy.supply(kord)) } + suspend fun createStageInstance(topic: String): StageInstance { val instance = kord.rest.stageInstance.createStageInstance(id, topic) val data = StageInstanceData.from(instance) diff --git a/core/src/samples/kotlin/PingBot.kt b/core/src/samples/kotlin/PingBot.kt index 048abf4e1b50..2582b8c3b667 100644 --- a/core/src/samples/kotlin/PingBot.kt +++ b/core/src/samples/kotlin/PingBot.kt @@ -1,4 +1,8 @@ import dev.kord.core.Kord +import dev.kord.core.behavior.channel.createStageInstance +import dev.kord.core.behavior.channel.getStageInstance +import dev.kord.core.behavior.getChannelOf +import dev.kord.core.entity.channel.StageChannel import dev.kord.core.event.message.MessageCreateEvent import dev.kord.core.on