Skip to content

Commit

Permalink
handle stage channels
Browse files Browse the repository at this point in the history
  • Loading branch information
HopeBaron committed Apr 24, 2021
1 parent f1f4d68 commit d346d5f
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
7 changes: 7 additions & 0 deletions core/src/main/kotlin/event/channel/ChannelCreateEvent.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand Down
6 changes: 6 additions & 0 deletions core/src/main/kotlin/event/channel/ChannelDeleteEvent.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
7 changes: 7 additions & 0 deletions core/src/main/kotlin/event/channel/ChannelUpdateEvent.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand Down
3 changes: 3 additions & 0 deletions core/src/main/kotlin/gateway/handler/ChannelEventHandler.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit d346d5f

Please sign in to comment.