From d346d5fd1c918c7d15f95e5d1f8b50df07cf85c7 Mon Sep 17 00:00:00 2001 From: HopeBaron Date: Sat, 24 Apr 2021 11:54:11 +0300 Subject: [PATCH] handle stage channels --- core/src/main/kotlin/event/channel/ChannelCreateEvent.kt | 7 +++++++ core/src/main/kotlin/event/channel/ChannelDeleteEvent.kt | 6 ++++++ core/src/main/kotlin/event/channel/ChannelUpdateEvent.kt | 7 +++++++ .../src/main/kotlin/gateway/handler/ChannelEventHandler.kt | 3 +++ 4 files changed, 23 insertions(+) diff --git a/core/src/main/kotlin/event/channel/ChannelCreateEvent.kt b/core/src/main/kotlin/event/channel/ChannelCreateEvent.kt index 560f497dd71..c43203c0062 100644 --- a/core/src/main/kotlin/event/channel/ChannelCreateEvent.kt +++ b/core/src/main/kotlin/event/channel/ChannelCreateEvent.kt @@ -46,6 +46,13 @@ class VoiceChannelCreateEvent(override val channel: VoiceChannel, override val s } } + +class StageChannelCreateEvent(override val channel: StageChannel, override val shard: Int) : ChannelCreateEvent { + override fun toString(): String { + return "StageChannelCreateEvent(channel=$channel, shard=$shard)" + } +} + class UnknownChannelCreateEvent(override val channel: Channel, override val shard: Int) : ChannelCreateEvent { override fun toString(): String { return "UnknownChannelCreateEvent(channel=$channel, shard=$shard)" diff --git a/core/src/main/kotlin/event/channel/ChannelDeleteEvent.kt b/core/src/main/kotlin/event/channel/ChannelDeleteEvent.kt index 5345f62b75a..08b8993721b 100644 --- a/core/src/main/kotlin/event/channel/ChannelDeleteEvent.kt +++ b/core/src/main/kotlin/event/channel/ChannelDeleteEvent.kt @@ -46,6 +46,12 @@ class VoiceChannelDeleteEvent(override val channel: VoiceChannel, override val s } } +class StageChannelDeleteEvent(override val channel: StageChannel, override val shard: Int) : ChannelDeleteEvent { + override fun toString(): String { + return "StageChannelDeleteEvent(channel=$channel, shard=$shard)" + } +} + class UnknownChannelDeleteEvent(override val channel: Channel, override val shard: Int) : ChannelCreateEvent { override fun toString(): String { diff --git a/core/src/main/kotlin/event/channel/ChannelUpdateEvent.kt b/core/src/main/kotlin/event/channel/ChannelUpdateEvent.kt index bb6db1e141f..a87316e07a4 100644 --- a/core/src/main/kotlin/event/channel/ChannelUpdateEvent.kt +++ b/core/src/main/kotlin/event/channel/ChannelUpdateEvent.kt @@ -47,6 +47,13 @@ class VoiceChannelUpdateEvent(override val channel: VoiceChannel, override val s } +class StageChannelUpdateEvent(override val channel: StageChannel, override val shard: Int) : ChannelUpdateEvent { + override fun toString(): String { + return "StageChannelUpdateEvent(channel=$channel, shard=$shard)" + } +} + + class UnknownChannelUpdateEvent(override val channel: Channel, override val shard: Int) : ChannelCreateEvent { override fun toString(): String { return "UnknownChannelUpdateEvent(channel=$channel, shard=$shard)" diff --git a/core/src/main/kotlin/gateway/handler/ChannelEventHandler.kt b/core/src/main/kotlin/gateway/handler/ChannelEventHandler.kt index eed6c8bb642..c2c23010f72 100644 --- a/core/src/main/kotlin/gateway/handler/ChannelEventHandler.kt +++ b/core/src/main/kotlin/gateway/handler/ChannelEventHandler.kt @@ -43,6 +43,7 @@ internal class ChannelEventHandler( is StoreChannel -> StoreChannelCreateEvent(channel, shard) is DmChannel -> DMChannelCreateEvent(channel, shard) is TextChannel -> TextChannelCreateEvent(channel, shard) + is StageChannel -> StageChannelCreateEvent(channel, shard) is VoiceChannel -> VoiceChannelCreateEvent(channel, shard) is Category -> CategoryCreateEvent(channel, shard) else -> UnknownChannelCreateEvent(channel, shard) @@ -60,6 +61,7 @@ internal class ChannelEventHandler( is StoreChannel -> StoreChannelUpdateEvent(channel, shard) is DmChannel -> DMChannelUpdateEvent(channel, shard) is TextChannel -> TextChannelUpdateEvent(channel, shard) + is StageChannel -> StageChannelUpdateEvent(channel, shard) is VoiceChannel -> VoiceChannelUpdateEvent(channel, shard) is Category -> CategoryUpdateEvent(channel, shard) else -> UnknownChannelUpdateEvent(channel, shard) @@ -77,6 +79,7 @@ internal class ChannelEventHandler( is StoreChannel -> StoreChannelDeleteEvent(channel, shard) is DmChannel -> DMChannelDeleteEvent(channel, shard) is TextChannel -> TextChannelDeleteEvent(channel, shard) + is StageChannel -> StageChannelDeleteEvent(channel, shard) is VoiceChannel -> VoiceChannelDeleteEvent(channel, shard) is Category -> CategoryDeleteEvent(channel, shard) else -> UnknownChannelDeleteEvent(channel, shard)