Docs / Developers / Referência / Event payloads
GeneratedSDK 0.10.120 events

Event payloads

Every event a plugin can subscribe to, with each payload field, its type and an example.

Subscribe with @plugin.on_event("name"). Every field is optional at the type level, so read with event.get("field"). Snowflakes are strings. Timestamps are ISO 8601.

channel_create

ChannelCreate7 fields

Payload for @plugin.on_event("channel_create") handlers.

CampoTipoSignificado
channel_idstr
idstralias for channel_id
namestr
typeintDiscord channel type
category_idOptional[str]
positionOptional[int]
guild_idOptional[str]

channel_delete

ChannelDelete7 fields

Payload for @plugin.on_event("channel_delete") handlers.

CampoTipoSignificado
channel_idstr
idstr
namestr
typeint
category_idOptional[str]
positionOptional[int]
guild_idOptional[str]

channel_update

ChannelUpdate8 fields

Payload for @plugin.on_event("channel_update") handlers. Top-level fields are the current state. The previous state, when available, lives under the before_* keys.

CampoTipoSignificado
channel_idstr
idstr
namestr
before_nameOptional[str]
typeint
category_idOptional[str]
positionOptional[int]
guild_idOptional[str]

interaction_create

InteractionCreate11 fields

Payload for @plugin.on_event("interaction_create") handlers. Fired when a user clicks a button, submits a modal, or invokes a slash command. For slash commands you usually want @plugin.on_slash_command("name") instead — it receives the same payload but only fires for the matching command.

CampoTipoSignificado
interaction_idstr
typeintDiscord interaction type (2=slash, 3=component, 5=modal)
interaction_typeintalias used by the testing harness
channel_idOptional[str]
user_idOptional[str]
user_nameOptional[str]
command_nameOptional[str]for slash commands
command_typeOptional[int]for slash commands
custom_idOptional[str]for component/modal interactions
modal_valuesdictfor modal submissions
guild_idOptional[str]
Example payload
{
  "channel_id": "999000000000000010",
  "command_name": "test",
  "command_type": 1,
  "interaction_id": "999000000000000099",
  "interaction_type": 2,
  "options": [],
  "user_id": "999000000000000020",
  "user_name": "test_user"
}

member_join

MemberJoin10 fields

Payload for @plugin.on_event("member_join") handlers.

CampoTipoSignificado
user_idstr
usernamestr
display_nameOptional[str]
botbool
joined_atOptional[str]ISO-8601 timestamp
roleslist[str]role IDs as strings
nickOptional[str]
guild_idOptional[str]
guild_nameOptional[str]
member_countintserver's total member count after join
Example payload
{
  "bot": false,
  "display_name": "Test User",
  "joined_at": "",
  "nick": null,
  "roles": [],
  "user_id": "999000000000000020",
  "username": "test_user"
}

member_leave

MemberLeave8 fields

Payload for @plugin.on_event("member_leave") handlers. Fired for both voluntary leaves and kicks/bans (Discord doesn't distinguish in the gateway event).

CampoTipoSignificado
user_idstr
usernamestr
display_nameOptional[str]
botbool
joined_atOptional[str]
roleslist[str]
nickOptional[str]
guild_idOptional[str]
Example payload
{
  "bot": false,
  "display_name": "Test User",
  "user_id": "999000000000000020",
  "username": "test_user"
}

member_update

MemberUpdate9 fields

Payload for @plugin.on_event("member_update") handlers. Fired on nick change, role change, timeout, avatar change. The new state is in the top-level fields; before_roles carries the prior role set.

CampoTipoSignificado
user_idstr
usernamestr
display_nameOptional[str]
botbool
roleslist[str]current roles
before_roleslist[str]roles before this update
nickOptional[str]
before_nickOptional[str]
guild_idOptional[str]

message_create

MessageCreate15 fields

Payload for @plugin.on_event("message_create") handlers. Fired when a message is sent in a server channel the bot can see.

CampoTipoSignificado
message_idstrsnowflake of the message
channel_idstrsnowflake of the channel
channel_nameOptional[str]channel display name (e.g. "general")
author_idstrsnowflake of the author user
author_nameOptional[str]author's Discord username
author_botboolTrue if the author is a bot
contentstrmessage body text (may be empty if only embeds/attachments)
created_atOptional[str]ISO-8601 timestamp
embed_countintnumber of embeds attached
attachment_countintnumber of file attachments
mention_countintnumber of users mentioned
reference_message_idOptional[str]Present only on replies; absent for normal messages.
author_usernameOptional[str]Aliases / extras populated by some surfaces (testing harness, older gateway).
guild_idOptional[str]
timestampOptional[str]
Example payload
{
  "attachment_count": 0,
  "author_bot": false,
  "author_id": "999000000000000020",
  "author_name": "test_user",
  "channel_id": "999000000000000010",
  "channel_name": "general",
  "content": "hello from replay",
  "created_at": "",
  "embed_count": 0,
  "mention_count": 0,
  "message_id": "999000000000000001"
}

message_delete

MessageDelete5 fields

Payload for @plugin.on_event("message_delete") handlers. Note: content is only present when the message was in the gateway cache at deletion time. Treat it as best-effort.

CampoTipoSignificado
message_idstr
channel_idstr
author_idOptional[str]
contentOptional[str]
guild_idOptional[str]
Example payload
{
  "attachment_count": 0,
  "author_id": "999000000000000020",
  "channel_id": "999000000000000010",
  "content": "",
  "embed_count": 0,
  "mention_count": 0,
  "message_id": "999000000000000001"
}

message_edit

MessageEdit8 fields

Payload for @plugin.on_event("message_edit") handlers.

CampoTipoSignificado
message_idstr
channel_idstr
author_idOptional[str]
contentstrpost-edit content
embed_countint
attachment_countint
mention_countint
guild_idOptional[str]
Example payload
{
  "attachment_count": 0,
  "author_id": "999000000000000020",
  "channel_id": "999000000000000010",
  "content": "edited from replay",
  "embed_count": 0,
  "mention_count": 0,
  "message_id": "999000000000000001"
}

reaction_add

ReactionAdd6 fields

Payload for @plugin.on_event("reaction_add") handlers.

CampoTipoSignificado
message_idstr
channel_idstr
user_idstr
emojistr``"👍"`` or ``"<a:name:id>"`` for custom
user_botbool
guild_idOptional[str]
Example payload
{
  "channel_id": "999000000000000010",
  "emoji": "wave",
  "guild_id": "999000000000000000",
  "message_id": "999000000000000001",
  "user_bot": false,
  "user_id": "999000000000000020"
}

reaction_remove

ReactionRemove6 fields

Payload for @plugin.on_event("reaction_remove") handlers.

CampoTipoSignificado
message_idstr
channel_idstr
user_idstr
emojistr
user_botbool
guild_idOptional[str]

role_create

RoleCreate9 fields

Payload for @plugin.on_event("role_create") handlers.

CampoTipoSignificado
role_idstr
idstr
namestr
colorintRGB integer
positionint
permissionsstrDiscord permission integer as string (precision-safe)
managedbool
mentionablebool
guild_idOptional[str]

role_delete

RoleDelete9 fields

Payload for @plugin.on_event("role_delete") handlers.

CampoTipoSignificado
role_idstr
idstr
namestr
colorint
positionint
permissionsstr
managedbool
mentionablebool
guild_idOptional[str]

role_update

RoleUpdate10 fields

Payload for @plugin.on_event("role_update") handlers.

CampoTipoSignificado
role_idstr
idstr
namestr
before_nameOptional[str]
colorint
positionint
permissionsstr
managedbool
mentionablebool
guild_idOptional[str]

voice_state_update

VoiceStateUpdate16 fields

Payload for @plugin.on_event("voice_state_update") handlers. Fired on join voice, leave voice, channel switch, mute/deafen, stream start/stop. The transition is encoded as before_channel_id (where they were, None = nowhere) and after_channel_id (where they are now, None = left voice entirely).

CampoTipoSignificado
user_idstr
usernameOptional[str]
botbool
member_botbool
before_channel_idOptional[str]
before_channel_nameOptional[str]
after_channel_idOptional[str]
after_channel_nameOptional[str]
before_self_streambool
after_self_streambool
self_mutebool
self_deafbool
self_streambool
self_videobool
guild_idOptional[str]
channel_idOptional[str]Convenience alias used by some handlers; same as after_channel_id.
Example payload
{
  "after_channel_id": "999000000000000050",
  "after_channel_name": "Voice Lobby",
  "before_channel_id": null,
  "before_channel_name": null,
  "bot": false,
  "self_deaf": false,
  "self_mute": false,
  "self_stream": false,
  "self_video": false,
  "user_id": "999000000000000020",
  "username": "test_user"
}

Also delivered

These events reach @plugin.on_event handlers too. They do not have a typed payload class in the SDK yet; their fields are listed under Build, Discord events.

guild_joinguild_removereaction_clearthread_create

Discord events in the Build guide

YourBot docs Reference tables are generated from the code that is running. Ask in Discord Suggest a correction