LiveKordEntity

A Discord entity that only emits events related to this entity.

For example, a LiveMessage will only emit MessageUpdateEvents of that message, and only emit reactions to that message.

Inheritors

Properties

Link copied to clipboard
Link copied to clipboard
abstract val events: Flow<Event>
Link copied to clipboard
abstract val id: Snowflake

The unique identifier of this entity.

Link copied to clipboard
abstract val kord: Kord

The kord instance that created this object.

Functions

Link copied to clipboard
open operator override fun compareTo(other: Entity): Int

Compares entities on id.

Link copied to clipboard
inline fun <T : Event> LiveKordEntity.on(scope: CoroutineScope = this, noinline consumer: suspend (T) -> Unit): Job

Convenience method that will invoke the consumer on every event T, the consumer is launched in the given scope or Kord by default and will not propagate any exceptions.

Link copied to clipboard
abstract fun shutDown(cause: CancellationException = CancellationException("The live entity is shut down", null))