EventDispatcher

Dispatcher which distributes events to function hooks

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
abstract suspend fun handleEvent(event: DiscordEvent, json: JsonElement)

Awaits all spawned jobs and returns any results

Link copied to clipboard
abstract fun onChannelCreate(handler: suspend (Channel) -> Unit)

Called when a channel is created, the current user gets access to a channel, or the current user receives a DM.

Link copied to clipboard
abstract fun onChannelDelete(handler: suspend (Channel) -> Unit)

Called when a channel is deleted.

Link copied to clipboard
abstract fun onChannelPinsUpdate(handler: suspend (ChannelPinUpdate) -> Unit)

Called when a message is pinned or unpinned in a channel.

Link copied to clipboard
abstract fun onChannelUpdate(handler: suspend (Channel) -> Unit)

Called when a channel is updated. Does not include TextChannel.lastMessageId updates.

Link copied to clipboard
abstract fun onGuildBanAdd(handler: suspend (GuildBan) -> Unit)

Called when a user is banned from a guild.

Link copied to clipboard
abstract fun onGuildBanRemove(handler: suspend (GuildBan) -> Unit)

Called when a user is unbanned from a guild.

Link copied to clipboard
abstract fun onGuildCreate(handler: suspend (CreatedGuild) -> Unit)

Called when the user first connects to lazy-fill unavailable guilds from the Ready event, a guild becomes available again, or the user joins a guild.

Link copied to clipboard
abstract fun onGuildDelete(handler: suspend (UnavailableGuild) -> Unit)

Called when a guild is unavailable or the user is removed.

Link copied to clipboard
abstract fun onGuildEmojiUpdate(handler: suspend (GuildEmojiUpdate) -> Unit)

Called when a guild's custom emoji have been updated.

Link copied to clipboard
abstract fun onGuildIntegrationsUpdate(handler: suspend (GuildIntegrationUpdate) -> Unit)

Called when a guild's integrations have been updated.

Link copied to clipboard
abstract fun onGuildInviteCreate(handler: suspend (GuildInviteCreate) -> Unit)

Called when an invite is created

Link copied to clipboard
abstract fun onGuildInviteDelete(handler: suspend (GuildInviteDelete) -> Unit)

Called when an invite is deleted

Link copied to clipboard
abstract fun onGuildMemberAdd(handler: suspend (GuildMemberAdd) -> Unit)

Called when someone joins a guild

Link copied to clipboard
abstract fun onGuildMemberRemove(handler: suspend (GuildMemberRemove) -> Unit)

Called when someone is removed from a guild, either from leaving, being kicked, or being banned

Link copied to clipboard
abstract fun onGuildMembersChunk(handler: suspend (GuildMembersChunk) -> Unit)

Sent in response to Guild Request Members

Link copied to clipboard
abstract fun onGuildMemberUpdate(handler: suspend (GuildMemberUpdate) -> Unit)

Called when a guild membership is updated

Link copied to clipboard
abstract fun onGuildRoleCreate(handler: suspend (GuildRoleCreate) -> Unit)

Called when a role is created

Link copied to clipboard
abstract fun onGuildRoleDelete(handler: suspend (GuildRoleDelete) -> Unit)

Called when a role is deleted

Link copied to clipboard
abstract fun onGuildRoleUpdate(handler: suspend (GuildRoleUpdate) -> Unit)

Called when a role is updated

Link copied to clipboard
abstract fun onGuildStickersUpdate(handler: suspend (GuildStickersUpdate) -> Unit)

Called when a guild's custom stickers have been updated.

Link copied to clipboard
abstract fun onGuildUpdate(handler: suspend (Guild) -> Unit)

Called when a guild is updated.

Link copied to clipboard
abstract fun onInit(handler: suspend (Ready) -> Unit)

Called on the first Ready event the bot receives

Link copied to clipboard
abstract fun onInteractionCreate(handler: suspend (Interaction) -> Unit)

Called when a new interaction is created.

Link copied to clipboard
abstract fun onMessageCreate(handler: suspend (Message) -> Unit)

Called when a message has been created.

Link copied to clipboard
abstract fun onMessageDelete(handler: suspend (MessageDelete) -> Unit)

Called when a message has been deleted.

Link copied to clipboard
abstract fun onMessageDeleteBulk(handler: suspend (BulkMessageDelete) -> Unit)

Called when messages have been bulk deleted.

Link copied to clipboard
abstract fun onMessageReactionAdd(handler: suspend (MessageReactionAdd) -> Unit)

Called when a message is reacted to.

Link copied to clipboard
abstract fun onMessageReactionRemove(handler: suspend (MessageReactionRemove) -> Unit)

Called when a message reaction is removed.

Link copied to clipboard
abstract fun onMessageReactionRemoveAll(handler: suspend (MessageReactionRemoveAll) -> Unit)

Called when a message has all reactions removed.

Link copied to clipboard

Called when a message has all reactions for a single emoji removed.

Link copied to clipboard
abstract fun onMessageUpdate(handler: suspend (Message) -> Unit)

Called when a message has been updated.

Link copied to clipboard
abstract fun onPresenceUpdate(handler: suspend (PresenceUpdate) -> Unit)

Called when a guild member's presence is updated.

Link copied to clipboard
abstract fun onReady(handler: suspend (Ready) -> Unit)

Called when a gateway acknowledges the connection as ready.

Link copied to clipboard
abstract fun onResume(handler: suspend (Resumed) -> Unit)

Called when a gateway acknowledges the connection has resumed.

Link copied to clipboard
abstract fun onThreadCreate(handler: suspend (GuildThread) -> Unit)

Called when a thread has been created.

Link copied to clipboard
abstract fun onThreadDelete(handler: suspend (ThreadDelete) -> Unit)

Called when a thread has been deleted.

Link copied to clipboard
abstract fun onThreadListSync(handler: suspend (ThreadListSync) -> Unit)

Called when added to a channel which has threads.

Link copied to clipboard
abstract fun onThreadMembersUpdate(handler: suspend (ThreadMembersUpdate) -> Unit)

Called when a user is added or removed from a thread.

Link copied to clipboard
abstract fun onThreadMembersUpdatePrivileged(handler: suspend (ThreadMembersUpdate) -> Unit)

Called when a user is added or removed from a thread.

Link copied to clipboard
abstract fun onThreadMemberUpdate(handler: suspend (ThreadMember) -> Unit)

Called when the thread member object for the current user is updated.

Link copied to clipboard
abstract fun onThreadUpdate(handler: suspend (GuildThread) -> Unit)

Called when a thread has been updated.

Link copied to clipboard
abstract fun onTypingStart(handler: suspend (TypingStart) -> Unit)

Called when a user starts typing.

Link copied to clipboard
abstract fun onUserUpdate(handler: suspend (User) -> Unit)

Called when a user is updated.

Link copied to clipboard
abstract fun onVoiceServerUpdate(handler: suspend (VoiceServerUpdate) -> Unit)

Called when a voice server is updated.

Link copied to clipboard
abstract fun onVoiceStateUpdate(handler: suspend (VoiceState) -> Unit)

Called when a joins, leaves, or moves voice channels.

Link copied to clipboard
abstract fun onWebhookUpdate(handler: suspend (WebhookUpdate) -> Unit)

Called when a guild webhook is updated.