AbstractLiveKordEntity

abstract class AbstractLiveKordEntity(val kord: Kord, coroutineScope: CoroutineScope = kord + SupervisorJob(kord.coroutineContext.job)) : LiveKordEntity, CoroutineScope(source)

Inheritors

Constructors

Link copied to clipboard
constructor(kord: Kord, coroutineScope: CoroutineScope = kord + SupervisorJob(kord.coroutineContext.job))

Properties

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

The unique identifier of this entity.

Link copied to clipboard
override 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
open override fun shutDown(cause: CancellationException)