Event Reference¶
Events are received in listeners using event_listener().
Event names are case-sensitive and uses underscores (_) for spaces.
APPLICATION_COMMAND_PERMISSIONS_UPDATE¶
Received when an application command’s permissions are updated. The inner payload is an GuildApplicationCommandPermissions object.
AUTO_MODERATION_ACTION_EXECUTION¶
Received when a rule is triggered and an action is executed (e.g. when a message is blocked).
- class discord.events.AutoModerationActionExecutionEvent[source]¶
Received when a rule is triggered and an action is executed (e.g. when a message is blocked).
- action: AutoModerationAction¶
Action which was executed
- alert_system_message_id: Optional[Snowflake]¶
ID of any system auto moderation messages posted as a result of this action.
Note
alert_system_message_idwill not exist if this event does not correspond to an action with typeAutoModerationActionType.
- content: str¶
User-generated text content
Note
MESSAGE_CONTENTgateway intent is required to receive thecontentandmatched_contentfields.
- matched_content: Nullable[str]¶
Substring in content that triggered the rule.
Note
MESSAGE_CONTENTgateway intent is required to receive thecontentandmatched_contentfields.
- message_id: Optional[Snowflake]¶
ID of any user message which content belongs to.
Note
message_idwill not exist if message was blocked by Auto Moderation or content was not part of any message.
- rule_trigger_type: AutoModerationRuleTriggerType¶
Trigger type of rule which was triggered
AUTO_MODERATION_RULE_CREATE¶
Received when a rule is created. The inner payload is an AutoModerationRule object.
AUTO_MODERATION_RULE_DELETE¶
Received when a rule is deleted. The inner payload is an AutoModerationRule object.
AUTO_MODERATION_RULE_UPDATE¶
Received when a rule is updated. The inner payload is an AutoModerationRule object.
CHANNEL_CREATE¶
Received when a new guild channel is created, relevant to the current user. The inner payload is a Channel object.
READY¶
Dispatched when the client has completed the initial handshake with the gateway (for new sessions).
- class discord.events.ReadyEvent[source]¶
- application: Application¶
- guilds: list[UnavailableGuild]¶
Guilds the user is in
- resume_gateway_url: str¶
Gateway URL for resuming connections
- session_id: str¶
Used for resuming connections
- shard: Optional[list[int, int]]¶
Shard information associated with this session, if sent when identifying
- v: int¶
API version