Events
EventGateway and client events. Listen with client:on(name, handler) or client:on(discord.Events.Name, handler). Argument types link to the corresponding API reference when the Client implementation wraps a structure.
local discord = require("discord")
local client = discord.Client({ intents = { "Guilds", "GuildMessages", "MessageContent" } })
client:on("messageCreate", function(message)
print(message.content)
end)
client:login(os.getenv("DISCORD_TOKEN"))ready
#discord.Events.ClientReady → "ready"
Trigger
After Identify succeeds and the initial guild set is cached. Also emitted as clientReady.
Arguments
| Argument | Type |
|---|---|
client | Client |
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("ready", function(client)
end)Alias: Events.Ready is the same string as ready.
error
#discord.Events.Error → "error"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to error runs in Client.
Arguments
No additional payload arguments. The handler is function().
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("error", function()
end)warn
#discord.Events.Warn → "warn"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to warn runs in Client.
Arguments
No additional payload arguments. The handler is function().
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("warn", function()
end)debug
#discord.Events.Debug → "debug"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to debug runs in Client.
Arguments
No additional payload arguments. The handler is function().
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("debug", function()
end)messageCreate
#discord.Events.MessageCreate → "messageCreate"
Trigger
A MESSAGE_CREATE Gateway dispatch was wrapped into a Message and stored on the channel cache when possible.
Arguments
| Argument | Type |
|---|---|
message | Message |
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("messageCreate", function(message)
end)messageUpdate
#discord.Events.MessageUpdate → "messageUpdate"
Trigger
A MESSAGE_UPDATE dispatch was wrapped. Partial messages follow Client partials.
Arguments
| Argument | Type |
|---|---|
message | Message |
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("messageUpdate", function(message)
end)messageDelete
#discord.Events.MessageDelete → "messageDelete"
Trigger
A MESSAGE_DELETE dispatch. The handler may receive a partial object if the message was not cached.
Arguments
| Argument | Type |
|---|---|
message | Message |
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("messageDelete", function(message)
end)messageDeleteBulk
#discord.Events.MessageBulkDelete → "messageDeleteBulk"
Trigger
A MESSAGE_DELETE_BULK dispatch. Arguments are the deleted messages collection and the channel.
Arguments
| Argument | Type |
|---|---|
messages | messages |
channel | Channel |
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("messageDeleteBulk", function(messages, channel)
end)Alias: Events.MessageDeleteBulk is the same string as messageDeleteBulk.
messagePollVoteAdd
#discord.Events.MessagePollVoteAdd → "messagePollVoteAdd"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to messagePollVoteAdd runs in Client.
Arguments
No additional payload arguments. The handler is function().
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("messagePollVoteAdd", function()
end)messagePollVoteRemove
#discord.Events.MessagePollVoteRemove → "messagePollVoteRemove"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to messagePollVoteRemove runs in Client.
Arguments
No additional payload arguments. The handler is function().
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("messagePollVoteRemove", function()
end)messageReactionAdd
#discord.Events.MessageReactionAdd → "messageReactionAdd"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to messageReactionAdd runs in Client.
Arguments
| Argument | Type |
|---|---|
reaction | reaction |
user | User |
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("messageReactionAdd", function(reaction, user)
end)messageReactionRemove
#discord.Events.MessageReactionRemove → "messageReactionRemove"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to messageReactionRemove runs in Client.
Arguments
| Argument | Type |
|---|---|
reaction | reaction |
user | User |
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("messageReactionRemove", function(reaction, user)
end)messageReactionRemoveAll
#discord.Events.MessageReactionRemoveAll → "messageReactionRemoveAll"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to messageReactionRemoveAll runs in Client.
Arguments
| Argument | Type |
|---|---|
message | Message |
reactions | reactions |
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("messageReactionRemoveAll", function(message, reactions)
end)messageReactionRemoveEmoji
#discord.Events.MessageReactionRemoveEmoji → "messageReactionRemoveEmoji"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to messageReactionRemoveEmoji runs in Client.
Arguments
| Argument | Type |
|---|---|
reaction | reaction |
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("messageReactionRemoveEmoji", function(reaction)
end)interactionCreate
#discord.Events.InteractionCreate → "interactionCreate"
Trigger
An INTERACTION_CREATE dispatch was wrapped into an Interaction subclass.
Arguments
| Argument | Type |
|---|---|
interaction | Interaction |
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("interactionCreate", function(interaction)
end)guildCreate
#discord.Events.GuildCreate → "guildCreate"
Trigger
A GUILD_CREATE dispatch added or updated a Guild on client.guilds.
Arguments
| Argument | Type |
|---|---|
guild | Guild |
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("guildCreate", function(guild)
end)guildUpdate
#discord.Events.GuildUpdate → "guildUpdate"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to guildUpdate runs in Client.
Arguments
| Argument | Type |
|---|---|
guild | Guild |
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("guildUpdate", function(guild)
end)guildDelete
#discord.Events.GuildDelete → "guildDelete"
Trigger
The client was removed from a guild, or the guild became unavailable.
Arguments
| Argument | Type |
|---|---|
wrapped | wrapped |
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("guildDelete", function(wrapped)
end)guildAvailable
#discord.Events.GuildAvailable → "guildAvailable"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to guildAvailable runs in Client.
Arguments
| Argument | Type |
|---|---|
guild | Guild |
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("guildAvailable", function(guild)
end)guildMemberAdd
#discord.Events.GuildMemberAdd → "guildMemberAdd"
Trigger
A member joined a guild and was added to that guild's member cache.
Arguments
| Argument | Type |
|---|---|
member | member |
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("guildMemberAdd", function(member)
end)guildMemberRemove
#discord.Events.GuildMemberRemove → "guildMemberRemove"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to guildMemberRemove runs in Client.
Arguments
| Argument | Type |
|---|---|
wrapped | wrapped |
enums | enums |
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("guildMemberRemove", function(wrapped, enums)
end)guildMemberUpdate
#discord.Events.GuildMemberUpdate → "guildMemberUpdate"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to guildMemberUpdate runs in Client.
Arguments
| Argument | Type |
|---|---|
member | member |
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("guildMemberUpdate", function(member)
end)guildMemberAvailable
#discord.Events.GuildMemberAvailable → "guildMemberAvailable"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to guildMemberAvailable runs in Client.
Arguments
| Argument | Type |
|---|---|
member | member |
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("guildMemberAvailable", function(member)
end)guildMembersChunk
#discord.Events.GuildMembersChunk → "guildMembersChunk"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to guildMembersChunk runs in Client.
Arguments
| Argument | Type |
|---|---|
members | members |
guild | Guild |
arg3 | arg3 |
count | count |
notFound | notFound |
nonce | nonce |
arg7 | arg7 |
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("guildMembersChunk", function(members, guild, arg3, count, notFound, nonce, arg7)
end)guildBanAdd
#discord.Events.GuildBanAdd → "guildBanAdd"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to guildBanAdd runs in Client.
Arguments
No additional payload arguments. The handler is function().
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("guildBanAdd", function()
end)guildBanRemove
#discord.Events.GuildBanRemove → "guildBanRemove"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to guildBanRemove runs in Client.
Arguments
No additional payload arguments. The handler is function().
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("guildBanRemove", function()
end)roleCreate
#discord.Events.GuildRoleCreate → "roleCreate"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to roleCreate runs in Client.
Arguments
| Argument | Type |
|---|---|
role | Role |
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("roleCreate", function(role)
end)roleUpdate
#discord.Events.GuildRoleUpdate → "roleUpdate"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to roleUpdate runs in Client.
Arguments
| Argument | Type |
|---|---|
role | Role |
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("roleUpdate", function(role)
end)roleDelete
#discord.Events.GuildRoleDelete → "roleDelete"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to roleDelete runs in Client.
Arguments
| Argument | Type |
|---|---|
role | Role |
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("roleDelete", function(role)
end)guildIntegrationsUpdate
#discord.Events.GuildIntegrationsUpdate → "guildIntegrationsUpdate"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to guildIntegrationsUpdate runs in Client.
Arguments
| Argument | Type |
|---|---|
data | data |
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("guildIntegrationsUpdate", function(data)
end)guildAuditLogEntryCreate
#discord.Events.GuildAuditLogEntryCreate → "guildAuditLogEntryCreate"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to guildAuditLogEntryCreate runs in Client.
Arguments
| Argument | Type |
|---|---|
entry | entry |
guild | Guild |
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("guildAuditLogEntryCreate", function(entry, guild)
end)guildScheduledEventCreate
#discord.Events.GuildScheduledEventCreate → "guildScheduledEventCreate"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to guildScheduledEventCreate runs in Client.
Arguments
No additional payload arguments. The handler is function().
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("guildScheduledEventCreate", function()
end)guildScheduledEventUpdate
#discord.Events.GuildScheduledEventUpdate → "guildScheduledEventUpdate"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to guildScheduledEventUpdate runs in Client.
Arguments
No additional payload arguments. The handler is function().
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("guildScheduledEventUpdate", function()
end)guildScheduledEventDelete
#discord.Events.GuildScheduledEventDelete → "guildScheduledEventDelete"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to guildScheduledEventDelete runs in Client.
Arguments
| Argument | Type |
|---|---|
guildScheduledEvent | GuildScheduledEvent |
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("guildScheduledEventDelete", function(guildScheduledEvent)
end)guildScheduledEventUserAdd
#discord.Events.GuildScheduledEventUserAdd → "guildScheduledEventUserAdd"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to guildScheduledEventUserAdd runs in Client.
Arguments
No additional payload arguments. The handler is function().
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("guildScheduledEventUserAdd", function()
end)guildScheduledEventUserRemove
#discord.Events.GuildScheduledEventUserRemove → "guildScheduledEventUserRemove"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to guildScheduledEventUserRemove runs in Client.
Arguments
No additional payload arguments. The handler is function().
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("guildScheduledEventUserRemove", function()
end)channelCreate
#discord.Events.ChannelCreate → "channelCreate"
Trigger
A channel was created and cached.
Arguments
| Argument | Type |
|---|---|
channel | Channel |
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("channelCreate", function(channel)
end)channelUpdate
#discord.Events.ChannelUpdate → "channelUpdate"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to channelUpdate runs in Client.
Arguments
| Argument | Type |
|---|---|
channel | Channel |
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("channelUpdate", function(channel)
end)channelDelete
#discord.Events.ChannelDelete → "channelDelete"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to channelDelete runs in Client.
Arguments
| Argument | Type |
|---|---|
channel | Channel |
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("channelDelete", function(channel)
end)channelPinsUpdate
#discord.Events.ChannelPinsUpdate → "channelPinsUpdate"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to channelPinsUpdate runs in Client.
Arguments
| Argument | Type |
|---|---|
channel | Channel |
data | data |
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("channelPinsUpdate", function(channel, data)
end)threadCreate
#discord.Events.ThreadCreate → "threadCreate"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to threadCreate runs in Client.
Arguments
| Argument | Type |
|---|---|
channel | Channel |
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("threadCreate", function(channel)
end)threadUpdate
#discord.Events.ThreadUpdate → "threadUpdate"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to threadUpdate runs in Client.
Arguments
| Argument | Type |
|---|---|
channel | Channel |
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("threadUpdate", function(channel)
end)threadDelete
#discord.Events.ThreadDelete → "threadDelete"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to threadDelete runs in Client.
Arguments
| Argument | Type |
|---|---|
channel | Channel |
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("threadDelete", function(channel)
end)threadListSync
#discord.Events.ThreadListSync → "threadListSync"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to threadListSync runs in Client.
Arguments
| Argument | Type |
|---|---|
threads | threads |
data | data |
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("threadListSync", function(threads, data)
end)threadMemberUpdate
#discord.Events.ThreadMemberUpdate → "threadMemberUpdate"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to threadMemberUpdate runs in Client.
Arguments
| Argument | Type |
|---|---|
member | member |
thread | thread |
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("threadMemberUpdate", function(member, thread)
end)threadMembersUpdate
#discord.Events.ThreadMembersUpdate → "threadMembersUpdate"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to threadMembersUpdate runs in Client.
Arguments
| Argument | Type |
|---|---|
added | added |
removed | removed |
thread | thread |
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("threadMembersUpdate", function(added, removed, thread)
end)presenceUpdate
#discord.Events.PresenceUpdate → "presenceUpdate"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to presenceUpdate runs in Client.
Arguments
| Argument | Type |
|---|---|
presence | Presence |
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("presenceUpdate", function(presence)
end)voiceStateUpdate
#discord.Events.VoiceStateUpdate → "voiceStateUpdate"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to voiceStateUpdate runs in Client.
Arguments
| Argument | Type |
|---|---|
state | state |
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("voiceStateUpdate", function(state)
end)voiceServerUpdate
#discord.Events.VoiceServerUpdate → "voiceServerUpdate"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to voiceServerUpdate runs in Client.
Arguments
| Argument | Type |
|---|---|
data | table |
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("voiceServerUpdate", function(data)
end)voiceChannelEffectSend
#discord.Events.VoiceChannelEffectSend → "voiceChannelEffectSend"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to voiceChannelEffectSend runs in Client.
Arguments
| Argument | Type |
|---|---|
data | table |
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("voiceChannelEffectSend", function(data)
end)resumed
#discord.Events.Resumed → "resumed"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to resumed runs in Client.
Arguments
| Argument | Type |
|---|---|
data | data |
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("resumed", function(data)
end)integrationCreate
#discord.Events.IntegrationCreate → "integrationCreate"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to integrationCreate runs in Client.
Arguments
No additional payload arguments. The handler is function().
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("integrationCreate", function()
end)integrationUpdate
#discord.Events.IntegrationUpdate → "integrationUpdate"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to integrationUpdate runs in Client.
Arguments
No additional payload arguments. The handler is function().
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("integrationUpdate", function()
end)integrationDelete
#discord.Events.IntegrationDelete → "integrationDelete"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to integrationDelete runs in Client.
Arguments
| Argument | Type |
|---|---|
data | table |
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("integrationDelete", function(data)
end)typingStart
#discord.Events.TypingStart → "typingStart"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to typingStart runs in Client.
Arguments
| Argument | Type |
|---|---|
typing | Typing |
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("typingStart", function(typing)
end)webhooksUpdate
#discord.Events.WebhooksUpdate → "webhooksUpdate"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to webhooksUpdate runs in Client.
Arguments
| Argument | Type |
|---|---|
channel | Channel |
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("webhooksUpdate", function(channel)
end)Alias: Events.WebhookUpdate is the same string as webhooksUpdate.
inviteCreate
#discord.Events.InviteCreate → "inviteCreate"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to inviteCreate runs in Client.
Arguments
| Argument | Type |
|---|---|
invite | Invite |
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("inviteCreate", function(invite)
end)inviteDelete
#discord.Events.InviteDelete → "inviteDelete"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to inviteDelete runs in Client.
Arguments
| Argument | Type |
|---|---|
invite | Invite |
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("inviteDelete", function(invite)
end)userUpdate
#discord.Events.UserUpdate → "userUpdate"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to userUpdate runs in Client.
Arguments
| Argument | Type |
|---|---|
user | User |
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("userUpdate", function(user)
end)emojiCreate
#discord.Events.EmojiCreate → "emojiCreate"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to emojiCreate runs in Client.
Arguments
No additional payload arguments. The handler is function().
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("emojiCreate", function()
end)emojiUpdate
#discord.Events.EmojiUpdate → "emojiUpdate"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to emojiUpdate runs in Client.
Arguments
No additional payload arguments. The handler is function().
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("emojiUpdate", function()
end)emojiDelete
#discord.Events.EmojiDelete → "emojiDelete"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to emojiDelete runs in Client.
Arguments
| Argument | Type |
|---|---|
emoji | emoji |
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("emojiDelete", function(emoji)
end)stickerCreate
#discord.Events.StickerCreate → "stickerCreate"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to stickerCreate runs in Client.
Arguments
No additional payload arguments. The handler is function().
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("stickerCreate", function()
end)stickerUpdate
#discord.Events.StickerUpdate → "stickerUpdate"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to stickerUpdate runs in Client.
Arguments
No additional payload arguments. The handler is function().
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("stickerUpdate", function()
end)stickerDelete
#discord.Events.StickerDelete → "stickerDelete"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to stickerDelete runs in Client.
Arguments
| Argument | Type |
|---|---|
sticker | sticker |
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("stickerDelete", function(sticker)
end)applicationCommandPermissionsUpdate
#discord.Events.ApplicationCommandPermissionsUpdate → "applicationCommandPermissionsUpdate"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to applicationCommandPermissionsUpdate runs in Client.
Arguments
| Argument | Type |
|---|---|
data | table |
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("applicationCommandPermissionsUpdate", function(data)
end)autoModerationActionExecution
#discord.Events.AutoModerationActionExecution → "autoModerationActionExecution"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to autoModerationActionExecution runs in Client.
Arguments
| Argument | Type |
|---|---|
autoModerationActionExecution | AutoModerationActionExecution |
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("autoModerationActionExecution", function(autoModerationActionExecution)
end)autoModerationRuleCreate
#discord.Events.AutoModerationRuleCreate → "autoModerationRuleCreate"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to autoModerationRuleCreate runs in Client.
Arguments
| Argument | Type |
|---|---|
autoModerationRule | AutoModerationRule |
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("autoModerationRuleCreate", function(autoModerationRule)
end)autoModerationRuleDelete
#discord.Events.AutoModerationRuleDelete → "autoModerationRuleDelete"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to autoModerationRuleDelete runs in Client.
Arguments
| Argument | Type |
|---|---|
autoModerationRule | AutoModerationRule |
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("autoModerationRuleDelete", function(autoModerationRule)
end)autoModerationRuleUpdate
#discord.Events.AutoModerationRuleUpdate → "autoModerationRuleUpdate"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to autoModerationRuleUpdate runs in Client.
Arguments
| Argument | Type |
|---|---|
autoModerationRule | AutoModerationRule |
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("autoModerationRuleUpdate", function(autoModerationRule)
end)entitlementCreate
#discord.Events.EntitlementCreate → "entitlementCreate"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to entitlementCreate runs in Client.
Arguments
No additional payload arguments. The handler is function().
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("entitlementCreate", function()
end)entitlementUpdate
#discord.Events.EntitlementUpdate → "entitlementUpdate"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to entitlementUpdate runs in Client.
Arguments
No additional payload arguments. The handler is function().
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("entitlementUpdate", function()
end)entitlementDelete
#discord.Events.EntitlementDelete → "entitlementDelete"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to entitlementDelete runs in Client.
Arguments
| Argument | Type |
|---|---|
entitlement | Entitlement |
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("entitlementDelete", function(entitlement)
end)stageInstanceCreate
#discord.Events.StageInstanceCreate → "stageInstanceCreate"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to stageInstanceCreate runs in Client.
Arguments
No additional payload arguments. The handler is function().
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("stageInstanceCreate", function()
end)stageInstanceUpdate
#discord.Events.StageInstanceUpdate → "stageInstanceUpdate"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to stageInstanceUpdate runs in Client.
Arguments
No additional payload arguments. The handler is function().
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("stageInstanceUpdate", function()
end)stageInstanceDelete
#discord.Events.StageInstanceDelete → "stageInstanceDelete"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to stageInstanceDelete runs in Client.
Arguments
No additional payload arguments. The handler is function().
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("stageInstanceDelete", function()
end)subscriptionCreate
#discord.Events.SubscriptionCreate → "subscriptionCreate"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to subscriptionCreate runs in Client.
Arguments
No additional payload arguments. The handler is function().
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("subscriptionCreate", function()
end)subscriptionUpdate
#discord.Events.SubscriptionUpdate → "subscriptionUpdate"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to subscriptionUpdate runs in Client.
Arguments
No additional payload arguments. The handler is function().
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("subscriptionUpdate", function()
end)subscriptionDelete
#discord.Events.SubscriptionDelete → "subscriptionDelete"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to subscriptionDelete runs in Client.
Arguments
| Argument | Type |
|---|---|
subscription | Subscription |
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("subscriptionDelete", function(subscription)
end)soundboardSounds
#discord.Events.SoundboardSounds → "soundboardSounds"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to soundboardSounds runs in Client.
Arguments
No additional payload arguments. The handler is function().
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("soundboardSounds", function()
end)guildSoundboardSoundCreate
#discord.Events.GuildSoundboardSoundCreate → "guildSoundboardSoundCreate"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to guildSoundboardSoundCreate runs in Client.
Arguments
No additional payload arguments. The handler is function().
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("guildSoundboardSoundCreate", function()
end)guildSoundboardSoundUpdate
#discord.Events.GuildSoundboardSoundUpdate → "guildSoundboardSoundUpdate"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to guildSoundboardSoundUpdate runs in Client.
Arguments
No additional payload arguments. The handler is function().
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("guildSoundboardSoundUpdate", function()
end)guildSoundboardSoundDelete
#discord.Events.GuildSoundboardSoundDelete → "guildSoundboardSoundDelete"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to guildSoundboardSoundDelete runs in Client.
Arguments
| Argument | Type |
|---|---|
soundboardSound | SoundboardSound |
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("guildSoundboardSoundDelete", function(soundboardSound)
end)guildSoundboardSoundsUpdate
#discord.Events.GuildSoundboardSoundsUpdate → "guildSoundboardSoundsUpdate"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to guildSoundboardSoundsUpdate runs in Client.
Arguments
No additional payload arguments. The handler is function().
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("guildSoundboardSoundsUpdate", function()
end)shardDisconnect
#discord.Events.ShardDisconnect → "shardDisconnect"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to shardDisconnect runs in Client.
Arguments
No additional payload arguments. The handler is function().
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("shardDisconnect", function()
end)shardError
#discord.Events.ShardError → "shardError"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to shardError runs in Client.
Arguments
No additional payload arguments. The handler is function().
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("shardError", function()
end)shardReady
#discord.Events.ShardReady → "shardReady"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to shardReady runs in Client.
Arguments
No additional payload arguments. The handler is function().
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("shardReady", function()
end)shardReconnecting
#discord.Events.ShardReconnecting → "shardReconnecting"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to shardReconnecting runs in Client.
Arguments
No additional payload arguments. The handler is function().
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("shardReconnecting", function()
end)shardResume
#discord.Events.ShardResume → "shardResume"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to shardResume runs in Client.
Arguments
No additional payload arguments. The handler is function().
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("shardResume", function()
end)shardCreate
#discord.Events.ShardCreate → "shardCreate"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to shardCreate runs in Client.
Arguments
No additional payload arguments. The handler is function().
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("shardCreate", function()
end)invalidated
#discord.Events.Invalidated → "invalidated"
Trigger
The session can no longer be used. Stop the process or create a new Client.
Arguments
No additional payload arguments. The handler is function().
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("invalidated", function()
end)cacheSweep
#discord.Events.CacheSweep → "cacheSweep"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to cacheSweep runs in Client.
Arguments
No additional payload arguments. The handler is function().
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("cacheSweep", function()
end)close
#discord.Events.WebSocketShardClose → "close"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to close runs in Client.
Arguments
No additional payload arguments. The handler is function().
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("close", function()
end)allReady
#discord.Events.WebSocketShardAllReady → "allReady"
Trigger
Dispatched when the Gateway payload or local Client lifecycle mapped to allReady runs in Client.
Arguments
No additional payload arguments. The handler is function().
Lifecycle
Handlers registered with Client:on run synchronously in registration order. Client:once removes the listener after the first successful emit. Errors in a handler do not automatically disconnect the Gateway.
Example
client:on("allReady", function()
end)