ChannelEvent

interface ChannelEvent

Generic interface for custom events that can contain channel behaviors. Mostly used by checks.

Properties

Link copied to clipboard
abstract val channel: ChannelBehavior?

The channel behavior for this event, if any.

Functions

Link copied to clipboard
abstract suspend fun getChannel(): Channel

Get a generic Channel object, or throw if one can't be retrieved.

Link copied to clipboard
inline suspend fun <T : Channel> ChannelEvent.getChannelOf(): T

Get a channel object of the given type, or throw if one can't be retrieved or cast.

Link copied to clipboard
inline suspend fun <T : Channel> ChannelEvent.getChannelOfOrNull(): T?

Get a channel object of the given type, or return null if one can't be retrieved or cast.

Link copied to clipboard
abstract suspend fun getChannelOrNull(): Channel?

Get a generic Channel object, or return null if one can't be retrieved.