Skip to content

Latest commit

 

History

History
1702 lines (1050 loc) · 52.4 KB

audit_logs.rst

File metadata and controls

1702 lines (1050 loc) · 52.4 KB

disnake

Audit Logs

Working with audit logs is a complicated process with a lot of machinery involved. The library attempts to make this user-friendly by making use of a couple of data classes and enums, listed below.

Discord Models

AuditLogEntry

AuditLogEntry

AuditLogEntry

Data Classes

AuditLogChanges

AuditLogChanges

An audit log change set.

before

The old value. The attribute has the type of AuditLogDiff.

Depending on the AuditLogActionCategory retrieved by ~AuditLogEntry.category, the data retrieved by this attribute differs:

Category

Description

~AuditLogActionCategory.create All attributes are set to None.
~AuditLogActionCategory.delete All attributes are set to the value before deletion.
~AuditLogActionCategory.update All attributes are set to the value before updating.
None No attributes are set.

after

The new value. The attribute has the type of AuditLogDiff.

Depending on the AuditLogActionCategory retrieved by ~AuditLogEntry.category, the data retrieved by this attribute differs:

Category

Description

~AuditLogActionCategory.create All attributes are set to the created value.
~AuditLogActionCategory.delete All attributes are set to None.
~AuditLogActionCategory.update All attributes are set to the value after updating.
None No attributes are set.

AuditLogDiff

AuditLogDiff

Represents an audit log "change" object. A change object has dynamic attributes that depend on the type of action being done. Certain actions map to certain attributes being set.

Note that accessing an attribute that does not match the specified action will lead to an attribute error.

To get a list of attributes that have been set, you can iterate over them. To see a list of all possible attributes that could be set based on the action being done, check the documentation for AuditLogAction, otherwise check the documentation below for all attributes that are possible.

iter(diff)

Returns an iterator over (attribute, value) tuples of this diff.

name

A name of something.

type

str

icon

A guild's or role's icon.

See also Guild.icon or Role.icon.

type

Asset

splash

The guild's invite splash. See also Guild.splash.

type

Asset

discovery_splash

The guild's discovery splash. See also Guild.discovery_splash.

type

Asset

banner

The guild's banner. See also Guild.banner.

type

Asset

owner

The guild's owner. See also Guild.owner

type

Union[Member, User, Object]

region

The guild's voice region. See also Guild.region.

type

str

afk_channel

The guild's AFK channel.

If this could not be found, then it falls back to a Object with the ID being set.

See Guild.afk_channel.

type

Union[VoiceChannel, Object]

system_channel

The guild's system channel.

If this could not be found, then it falls back to a Object with the ID being set.

See Guild.system_channel.

type

Union[TextChannel, Object]

rules_channel

The guild's rules channel.

If this could not be found then it falls back to a Object with the ID being set.

See Guild.rules_channel.

type

Union[TextChannel, Object]

public_updates_channel

The guild's public updates channel.

If this could not be found then it falls back to a Object with the ID being set.

See Guild.public_updates_channel.

type

Union[TextChannel, Object]

afk_timeout

The guild's AFK timeout. See Guild.afk_timeout.

type

int

mfa_level

The guild's MFA level. See Guild.mfa_level.

type

int

widget_enabled

The guild's widget has been enabled or disabled.

type

bool

widget_channel

The widget's channel.

If this could not be found then it falls back to a Object with the ID being set.

type

Union[abc.GuildChannel, Object]

verification_level

The guild's verification level.

See also Guild.verification_level.

type

VerificationLevel

premium_progress_bar_enabled

Whether the guild's premium progress bar is enabled.

See also Guild.premium_progress_bar_enabled.

type

bool

default_notifications

The guild's default notification level.

See also Guild.default_notifications.

type

NotificationLevel

explicit_content_filter

The guild's content filter.

See also Guild.explicit_content_filter.

type

ContentFilter

default_message_notifications

The guild's default message notification setting.

type

int

vanity_url_code

The guild's vanity URL code.

See also Guild.vanity_invite, Guild.edit, and Guild.vanity_url_code.

type

str

preferred_locale

The guild's preferred locale.

type

Locale

position

The position of a Role or abc.GuildChannel.

type

int

type

The type of channel/thread, sticker, webhook, integration (str), or permission overwrite (int).

type

Union[ChannelType, StickerType, WebhookType, str, int]

topic

The topic of a TextChannel, StageChannel, StageInstance or ForumChannel.

See also TextChannel.topic, StageChannel.topic, StageInstance.topic or ForumChannel.topic.

type

str

bitrate

The bitrate of a VoiceChannel or StageChannel.

See also VoiceChannel.bitrate or StageChannel.bitrate.

type

int

overwrites

A list of permission overwrite tuples that represents a target and a PermissionOverwrite for said target.

The first element is the object being targeted, which can either be a Member or User or Role. If this object is not found then it is a Object with an ID being filled and a type attribute set to either 'role' or 'member' to help decide what type of ID it is.

type

List[Tuple[Union[Member, User, Role, Object], PermissionOverwrite]]

privacy_level

The privacy level of the stage instance or guild scheduled event.

type

Union[StagePrivacyLevel, GuildScheduledEventPrivacyLevel]

roles

A list of roles being added or removed from a member.

If a role is not found then it is a Object with the ID and name being filled in.

type

List[Union[Role, Object]]

nick

The nickname of a member.

See also Member.nick

type

Optional[str]

deaf

Whether the member is being server deafened.

See also VoiceState.deaf.

type

bool

mute

Whether the member is being server muted.

See also VoiceState.mute.

type

bool

permissions

The permissions of a role.

See also Role.permissions.

type

Permissions

colour color

The colour of a role.

See also Role.colour

type

Colour

hoist

Whether the role is being hoisted or not.

See also Role.hoist

type

bool

mentionable

Whether the role is mentionable or not.

See also Role.mentionable

type

bool

code

The invite's code.

See also Invite.code

type

str

channel

A guild channel.

If the channel is not found then it is a Object with the ID being set. In some cases the channel name is also set.

type

Union[abc.GuildChannel, Object]

inviter

The user who created the invite.

See also Invite.inviter.

type

Optional[User, Object]

max_uses

The invite's max uses.

See also Invite.max_uses.

type

int

uses

The invite's current uses.

See also Invite.uses.

type

int

max_age

The invite's max age in seconds.

See also Invite.max_age.

type

int

temporary

If the invite is a temporary invite.

See also Invite.temporary.

type

bool

allow deny

The permissions being allowed or denied.

type

Permissions

id

The ID of the object being changed.

type

int

avatar

The avatar of a member.

See also User.avatar.

type

Asset

slowmode_delay

The number of seconds members have to wait before sending another message or creating another thread in the channel.

See also TextChannel.slowmode_delay, VoiceChannel.slowmode_delay, StageChannel.slowmode_delay, ForumChannel.slowmode_delay, or Thread.slowmode_delay.

type

int

default_thread_slowmode_delay

The default number of seconds members have to wait before sending another message in new threads created in the channel.

See also TextChannel.default_thread_slowmode_delay or ForumChannel.default_thread_slowmode_delay.

type

int

rtc_region

The region for the voice or stage channel's voice communication. A value of None indicates automatic voice region detection.

See also VoiceChannel.rtc_region or StageChannel.rtc_region.

type

str

video_quality_mode

The camera video quality for the voice or stage channel's participants.

See also VoiceChannel.video_quality_mode or StageChannel.video_quality_mode.

type

VideoQualityMode

user_limit

The voice channel's user limit.

See also VoiceChannel.user_limit, or StageChannel.user_limit.

type

int

nsfw

Whether the channel is marked as "not safe for work".

See also TextChannel.nsfw, VoiceChannel.nsfw, StageChannel.nsfw, or ForumChannel.nsfw.

type

bool

format_type

The format type of a sticker being changed.

See also GuildSticker.format

type

StickerFormatType

emoji

The name of the sticker's or role's emoji being changed.

See also GuildSticker.emoji or Role.emoji.

type

str

description

The description of a guild, sticker or a guild scheduled event being changed.

See also Guild.description, GuildSticker.description, GuildScheduledEvent.description

type

str

available

The availability of a sticker being changed.

See also GuildSticker.available

type

bool

archived

The thread is now archived.

type

bool

locked

The thread is being locked or unlocked.

type

bool

auto_archive_duration

The thread's auto archive duration being changed.

See also Thread.auto_archive_duration

type

int

default_auto_archive_duration

The default auto archive duration for newly created threads being changed.

type

int

invitable

Whether non-moderators can add other non-moderators to the thread.

type

bool

timeout

The datetime when the timeout expires, if any.

type

datetime.datetime

entity_type

The entity type of a guild scheduled event being changed.

type

GuildScheduledEventEntityType

location

The location of a guild scheduled event being changed.

type

str

status

The status of a guild scheduled event being changed.

type

GuildScheduledEventStatus

image

The cover image of a guild scheduled event being changed.

type

Asset

command_permissions

A mapping of target ID to guild permissions of an application command.

Note that only changed permission entries are included, not necessarily all of the command's permissions.

type

Dict[int, ApplicationCommandPermissions]

application_id

The ID of the application that created a webhook.

type

int

flags

The channel's flags.

See also abc.GuildChannel.flags or Thread.flags.

type

ChannelFlags

system_channel_flags

The guild's system channel settings.

See also Guild.system_channel_flags.

type

SystemChannelFlags

enabled

Whether something was enabled or disabled.

type

bool

trigger_type

The trigger type of an auto moderation rule being changed.

type

AutoModTriggerType

event_type

The event type of an auto moderation rule being changed.

type

AutoModEventType

actions

The list of actions of an auto moderation rule being changed.

type

List[AutoModAction]

trigger_metadata

The additional trigger metadata of an auto moderation rule being changed.

type

AutoModTriggerMetadata

exempt_roles

The list of roles that are exempt from an auto moderation rule being changed.

If a role is not found then it is an Object with the ID being set.

type

List[Union[Role, Object]]

exempt_channels

The list of channels that are exempt from an auto moderation rule being changed.

If a channel is not found then it is an Object with the ID being set.

type

List[Union[abc.GuildChannel, Object]]

applied_tags

The tags applied to a thread in a forum channel being changed.

If a tag is not found, then it is an Object with the ID being set.

type

List[Union[ForumTag, Object]]

available_tags

The available tags for threads in a forum channel being changed.

type

List[ForumTag]

default_reaction

The default emoji shown for reacting to threads in a forum channel being changed.

Due to a Discord limitation, this will have an empty ~PartialEmoji.name if it is a custom PartialEmoji.

type

Optional[Union[Emoji, PartialEmoji]]

default_sort_order

The default sort order of threads in a forum channel being changed.

type

Optional[ThreadSortOrder]

Enumerations

AuditLogAction

Represents the type of action being done for a AuditLogEntry, which is retrievable via Guild.audit_logs or via the on_audit_log_entry_create event.

guild_update

The guild has updated. Things that trigger this include:

  • Changing the guild vanity URL
  • Changing the guild invite splash
  • Changing the guild AFK channel or timeout
  • Changing the guild voice server region
  • Changing the guild icon, banner, or discovery splash
  • Changing the guild moderation settings
  • Changing things related to the guild widget

When this is the action, the type of ~AuditLogEntry.target is the Guild.

Possible attributes for AuditLogDiff:

  • ~AuditLogDiff.afk_channel
  • ~AuditLogDiff.system_channel
  • ~AuditLogDiff.afk_timeout
  • ~AuditLogDiff.default_message_notifications
  • ~AuditLogDiff.explicit_content_filter
  • ~AuditLogDiff.mfa_level
  • ~AuditLogDiff.name
  • ~AuditLogDiff.owner
  • ~AuditLogDiff.splash
  • ~AuditLogDiff.discovery_splash
  • ~AuditLogDiff.icon
  • ~AuditLogDiff.banner
  • ~AuditLogDiff.vanity_url_code
  • ~AuditLogDiff.preferred_locale
  • ~AuditLogDiff.description
  • ~AuditLogDiff.rules_channel
  • ~AuditLogDiff.public_updates_channel
  • ~AuditLogDiff.widget_enabled
  • ~AuditLogDiff.widget_channel
  • ~AuditLogDiff.verification_level
  • ~AuditLogDiff.premium_progress_bar_enabled
  • ~AuditLogDiff.system_channel_flags

channel_create

A new channel was created.

When this is the action, the type of ~AuditLogEntry.target is either a abc.GuildChannel or Object with an ID.

A more filled out object in the Object case can be found by using ~AuditLogEntry.after.

Possible attributes for AuditLogDiff:

  • ~AuditLogDiff.name
  • ~AuditLogDiff.type
  • ~AuditLogDiff.overwrites
  • ~AuditLogDiff.topic
  • ~AuditLogDiff.bitrate
  • ~AuditLogDiff.rtc_region
  • ~AuditLogDiff.video_quality_mode
  • ~AuditLogDiff.default_auto_archive_duration
  • ~AuditLogDiff.user_limit
  • ~AuditLogDiff.slowmode_delay
  • ~AuditLogDiff.default_thread_slowmode_delay
  • ~AuditLogDiff.nsfw
  • ~AuditLogDiff.available_tags
  • ~AuditLogDiff.default_reaction

channel_update

A channel was updated. Things that trigger this include:

  • The channel name or topic was changed
  • The channel bitrate was changed

When this is the action, the type of ~AuditLogEntry.target is the abc.GuildChannel or Object with an ID.

A more filled out object in the Object case can be found by using ~AuditLogEntry.after or ~AuditLogEntry.before.

Possible attributes for AuditLogDiff:

  • ~AuditLogDiff.name
  • ~AuditLogDiff.type
  • ~AuditLogDiff.position
  • ~AuditLogDiff.overwrites
  • ~AuditLogDiff.topic
  • ~AuditLogDiff.bitrate
  • ~AuditLogDiff.rtc_region
  • ~AuditLogDiff.video_quality_mode
  • ~AuditLogDiff.default_auto_archive_duration
  • ~AuditLogDiff.user_limit
  • ~AuditLogDiff.slowmode_delay
  • ~AuditLogDiff.default_thread_slowmode_delay
  • ~AuditLogDiff.nsfw
  • ~AuditLogDiff.available_tags
  • ~AuditLogDiff.default_reaction

channel_delete

A channel was deleted.

When this is the action, the type of ~AuditLogEntry.target is an Object with an ID.

A more filled out object can be found by using the ~AuditLogEntry.before object.

Possible attributes for AuditLogDiff:

  • ~AuditLogDiff.name
  • ~AuditLogDiff.type
  • ~AuditLogDiff.overwrites
  • ~AuditLogDiff.topic
  • ~AuditLogDiff.bitrate
  • ~AuditLogDiff.rtc_region
  • ~AuditLogDiff.video_quality_mode
  • ~AuditLogDiff.default_auto_archive_duration
  • ~AuditLogDiff.user_limit
  • ~AuditLogDiff.slowmode_delay
  • ~AuditLogDiff.default_thread_slowmode_delay
  • ~AuditLogDiff.nsfw
  • ~AuditLogDiff.available_tags
  • ~AuditLogDiff.default_reaction

overwrite_create

A channel permission overwrite was created.

When this is the action, the type of ~AuditLogEntry.target is the abc.GuildChannel or Object with an ID.

When this is the action, the type of ~AuditLogEntry.extra is either a Role or Member. If the object is not found then it is a Object with an ID being filled, a name, and a type attribute set to either 'role' or 'member' to help dictate what type of ID it is.

Possible attributes for AuditLogDiff:

  • ~AuditLogDiff.deny
  • ~AuditLogDiff.allow
  • ~AuditLogDiff.id
  • ~AuditLogDiff.type

2.6 ~AuditLogDiff.type for this action is now an int.

overwrite_update

A channel permission overwrite was changed, this is typically when the permission values change.

See overwrite_create for more information on how the ~AuditLogEntry.target and ~AuditLogEntry.extra fields are set.

Possible attributes for AuditLogDiff:

  • ~AuditLogDiff.deny
  • ~AuditLogDiff.allow
  • ~AuditLogDiff.id
  • ~AuditLogDiff.type

2.6 ~AuditLogDiff.type for this action is now an int.

overwrite_delete

A channel permission overwrite was deleted.

See overwrite_create for more information on how the ~AuditLogEntry.target and ~AuditLogEntry.extra fields are set.

Possible attributes for AuditLogDiff:

  • ~AuditLogDiff.deny
  • ~AuditLogDiff.allow
  • ~AuditLogDiff.id
  • ~AuditLogDiff.type

2.6 ~AuditLogDiff.type for this action is now an int.

kick

A member was kicked.

When this is the action, the type of ~AuditLogEntry.target is the User who got kicked. If the user is not found then it is a Object with the user's ID.

When this is the action, ~AuditLogEntry.changes is empty.

member_prune

A member prune was triggered.

When this is the action, the type of ~AuditLogEntry.target is set to None.

When this is the action, the type of ~AuditLogEntry.extra is set to an unspecified proxy object with two attributes:

  • delete_member_days: An integer specifying how far the prune was.
  • members_removed: An integer specifying how many members were removed.

When this is the action, ~AuditLogEntry.changes is empty.

ban

A member was banned.

When this is the action, the type of ~AuditLogEntry.target is the User who got banned. If the user is not found then it is a Object with the user's ID.

When this is the action, ~AuditLogEntry.changes is empty.

unban

A member was unbanned.

When this is the action, the type of ~AuditLogEntry.target is the User who got unbanned. If the user is not found then it is a Object with the user's ID.

When this is the action, ~AuditLogEntry.changes is empty.

member_update

A member has updated. This triggers in the following situations:

  • A nickname was changed
  • They were server muted or deafened (or it was undone)
  • They were timed out

When this is the action, the type of ~AuditLogEntry.target is the Member or User who got updated. If the user is not found then it is a Object with the user's ID.

Possible attributes for AuditLogDiff:

  • ~AuditLogDiff.nick
  • ~AuditLogDiff.mute
  • ~AuditLogDiff.deaf
  • ~AuditLogDiff.timeout

member_role_update

A member's role has been updated. This triggers when a member either gains a role or loses a role.

When this is the action, the type of ~AuditLogEntry.target is the Member or User who got the role. If the user is not found then it is a Object with the user's ID.

Possible attributes for AuditLogDiff:

  • ~AuditLogDiff.roles

member_move

A member's voice channel has been updated. This triggers when a member is moved to a different voice channel.

When this is the action, the type of ~AuditLogEntry.extra is set to an unspecified proxy object with two attributes:

  • channel: A abc.GuildChannel or Object with the channel ID where the members were moved.
  • count: An integer specifying how many members were moved.

1.3

member_disconnect

A member's voice state has changed. This triggers when a member is force disconnected from voice.

When this is the action, the type of ~AuditLogEntry.extra is set to an unspecified proxy object with one attribute:

  • count: An integer specifying how many members were disconnected.

1.3

bot_add

A bot was added to the guild.

When this is the action, the type of ~AuditLogEntry.target is the Member or User which was added to the guild. If the user is not found then it is a Object with an ID.

1.3

role_create

A new role was created.

When this is the action, the type of ~AuditLogEntry.target is the Role or a Object with the ID.

Possible attributes for AuditLogDiff:

  • ~AuditLogDiff.colour
  • ~AuditLogDiff.mentionable
  • ~AuditLogDiff.hoist
  • ~AuditLogDiff.name
  • ~AuditLogDiff.permissions
  • ~AuditLogDiff.icon
  • ~AuditLogDiff.emoji

role_update

A role was updated. This triggers in the following situations:

  • The name has changed
  • The permissions have changed
  • The colour has changed
  • Its hoist/mentionable state has changed

When this is the action, the type of ~AuditLogEntry.target is the Role or a Object with the ID.

Possible attributes for AuditLogDiff:

  • ~AuditLogDiff.colour
  • ~AuditLogDiff.mentionable
  • ~AuditLogDiff.hoist
  • ~AuditLogDiff.name
  • ~AuditLogDiff.permissions
  • ~AuditLogDiff.icon
  • ~AuditLogDiff.emoji

role_delete

A role was deleted.

When this is the action, the type of ~AuditLogEntry.target is the Object with the ID.

Possible attributes for AuditLogDiff:

  • ~AuditLogDiff.colour
  • ~AuditLogDiff.mentionable
  • ~AuditLogDiff.hoist
  • ~AuditLogDiff.name
  • ~AuditLogDiff.permissions
  • ~AuditLogDiff.icon
  • ~AuditLogDiff.emoji

invite_create

An invite was created.

When this is the action, the type of ~AuditLogEntry.target is the Invite that was created.

Possible attributes for AuditLogDiff:

  • ~AuditLogDiff.max_age
  • ~AuditLogDiff.code
  • ~AuditLogDiff.temporary
  • ~AuditLogDiff.inviter
  • ~AuditLogDiff.channel
  • ~AuditLogDiff.uses
  • ~AuditLogDiff.max_uses

invite_update

An invite was updated.

When this is the action, the type of ~AuditLogEntry.target is the Invite that was updated.

invite_delete

An invite was deleted.

When this is the action, the type of ~AuditLogEntry.target is the Invite that was deleted.

Possible attributes for AuditLogDiff:

  • ~AuditLogDiff.max_age
  • ~AuditLogDiff.code
  • ~AuditLogDiff.temporary
  • ~AuditLogDiff.inviter
  • ~AuditLogDiff.channel
  • ~AuditLogDiff.uses
  • ~AuditLogDiff.max_uses

webhook_create

A webhook was created.

When this is the action, the type of ~AuditLogEntry.target is the Webhook or Object with the webhook ID.

Possible attributes for AuditLogDiff:

  • ~AuditLogDiff.channel
  • ~AuditLogDiff.name
  • ~AuditLogDiff.type
  • ~AuditLogDiff.application_id
  • ~AuditLogDiff.avatar

2.6 Added ~AuditLogDiff.application_id.

2.6 ~AuditLogDiff.type for this action is now a WebhookType.

2.6 Added support for Webhook instead of plain Objects.

webhook_update

A webhook was updated. This trigger in the following situations:

  • The webhook name changed
  • The webhook channel changed

When this is the action, the type of ~AuditLogEntry.target is the Webhook or Object with the webhook ID.

Possible attributes for AuditLogDiff:

  • ~AuditLogDiff.channel
  • ~AuditLogDiff.name
  • ~AuditLogDiff.avatar

2.6 Added support for Webhook instead of plain Objects.

webhook_delete

A webhook was deleted.

When this is the action, the type of ~AuditLogEntry.target is the Object with the webhook ID.

Possible attributes for AuditLogDiff:

  • ~AuditLogDiff.channel
  • ~AuditLogDiff.name
  • ~AuditLogDiff.type
  • ~AuditLogDiff.application_id
  • ~AuditLogDiff.avatar

2.6 Added ~AuditLogDiff.application_id.

2.6 ~AuditLogDiff.type for this action is now a WebhookType.

emoji_create

An emoji was created.

When this is the action, the type of ~AuditLogEntry.target is the Emoji or Object with the emoji ID.

Possible attributes for AuditLogDiff:

  • ~AuditLogDiff.name

emoji_update

An emoji was updated. This triggers when the name has changed.

When this is the action, the type of ~AuditLogEntry.target is the Emoji or Object with the emoji ID.

Possible attributes for AuditLogDiff:

  • ~AuditLogDiff.name

emoji_delete

An emoji was deleted.

When this is the action, the type of ~AuditLogEntry.target is the Object with the emoji ID.

Possible attributes for AuditLogDiff:

  • ~AuditLogDiff.name

message_delete

A message was deleted by a moderator. Note that this only triggers if the message was deleted by someone other than the author.

When this is the action, the type of ~AuditLogEntry.target is the Member or User who had their message deleted. If the user is not found then it is a Object with the user's ID.

When this is the action, the type of ~AuditLogEntry.extra is set to an unspecified proxy object with two attributes:

  • count: An integer specifying how many messages were deleted.
  • channel: A abc.GuildChannel, Thread or Object with the channel ID where the message got deleted.

message_bulk_delete

Messages were bulk deleted by a moderator.

When this is the action, the type of ~AuditLogEntry.target is the TextChannel or Object with the ID of the channel that was purged.

When this is the action, the type of ~AuditLogEntry.extra is set to an unspecified proxy object with one attribute:

  • count: An integer specifying how many messages were deleted.

1.3

message_pin

A message was pinned in a channel.

When this is the action, the type of ~AuditLogEntry.target is the Member or User who had their message pinned. If the user is not found then it is a Object with the user's ID.

When this is the action, the type of ~AuditLogEntry.extra is set to an unspecified proxy object with two attributes:

  • channel: A abc.GuildChannel, Thread or Object with the channel ID where the message was pinned.
  • message_id: the ID of the message which was pinned.

1.3

message_unpin

A message was unpinned in a channel.

When this is the action, the type of ~AuditLogEntry.target is the Member or User who had their message unpinned. If the user is not found then it is a Object with the user's ID.

When this is the action, the type of ~AuditLogEntry.extra is set to an unspecified proxy object with two attributes:

  • channel: A abc.GuildChannel, Thread or Object with the channel ID where the message was unpinned.
  • message_id: the ID of the message which was unpinned.

1.3

integration_create

A guild integration was created.

When this is the action, the type of ~AuditLogEntry.target is the PartialIntegration or Object with the integration ID of the integration which was created.

Possible attributes for AuditLogDiff:

  • ~AuditLogDiff.type

1.3

2.6 Added support for PartialIntegration instead of plain Objects.

integration_update

A guild integration was updated.

When this is the action, the type of ~AuditLogEntry.target is the PartialIntegration or Object with the integration ID of the integration which was updated.

1.3

2.6 Added support for PartialIntegration instead of plain Objects.

integration_delete

A guild integration was deleted.

When this is the action, the type of ~AuditLogEntry.target is the Object with the integration ID of the integration which was deleted.

Possible attributes for AuditLogDiff:

  • ~AuditLogDiff.type

1.3

guild_scheduled_event_create

A guild scheduled event was created.

When this is the action, the type of ~AuditLogEntry.target is the GuildScheduledEvent or Object with the ID of the event which was created.

Possible attributes for AuditLogDiff:

  • ~AuditLogDiff.name
  • ~AuditLogDiff.description
  • ~AuditLogDiff.privacy_level
  • ~AuditLogDiff.status
  • ~AuditLogDiff.entity_type
  • ~AuditLogDiff.channel
  • ~AuditLogDiff.location
  • ~AuditLogDiff.image

2.3

guild_scheduled_event_update

A guild scheduled event was updated.

When this is the action, the type of ~AuditLogEntry.target is the GuildScheduledEvent or Object with the ID of the event which was updated.

Possible attributes for AuditLogDiff:

  • ~AuditLogDiff.name
  • ~AuditLogDiff.description
  • ~AuditLogDiff.privacy_level
  • ~AuditLogDiff.status
  • ~AuditLogDiff.entity_type
  • ~AuditLogDiff.channel
  • ~AuditLogDiff.location
  • ~AuditLogDiff.image

2.3

guild_scheduled_event_delete

A guild scheduled event was deleted.

When this is the action, the type of ~AuditLogEntry.target is the Object with the ID of the event which was deleted.

Possible attributes for AuditLogDiff:

  • ~AuditLogDiff.name
  • ~AuditLogDiff.description
  • ~AuditLogDiff.privacy_level
  • ~AuditLogDiff.status
  • ~AuditLogDiff.entity_type
  • ~AuditLogDiff.channel
  • ~AuditLogDiff.location
  • ~AuditLogDiff.image

2.3

stage_instance_create

A stage instance was started.

When this is the action, the type of ~AuditLogEntry.target is the StageInstance or Object with the ID of the stage instance which was created.

When this is the action, the type of ~AuditLogEntry.extra is set to an unspecified proxy object with one attribute:

  • channel: The StageChannel or Object with the channel ID where the stage instance was started.

Possible attributes for AuditLogDiff:

  • ~AuditLogDiff.topic
  • ~AuditLogDiff.privacy_level

2.0

stage_instance_update

A stage instance was updated.

When this is the action, the type of ~AuditLogEntry.target is the StageInstance or Object with the ID of the stage instance which was updated.

See stage_instance_create for more information on how the ~AuditLogEntry.extra field is set.

Possible attributes for AuditLogDiff:

  • ~AuditLogDiff.topic
  • ~AuditLogDiff.privacy_level

2.0

stage_instance_delete

A stage instance was ended.

See stage_instance_create for more information on how the ~AuditLogEntry.extra field is set.

Possible attributes for AuditLogDiff:

  • ~AuditLogDiff.topic
  • ~AuditLogDiff.privacy_level

2.0

sticker_create

A sticker was created.

When this is the action, the type of ~AuditLogEntry.target is the GuildSticker or Object with the ID of the sticker which was created.

Possible attributes for AuditLogDiff:

  • ~AuditLogDiff.name
  • ~AuditLogDiff.emoji
  • ~AuditLogDiff.type
  • ~AuditLogDiff.format_type
  • ~AuditLogDiff.description
  • ~AuditLogDiff.available

2.0

sticker_update

A sticker was updated.

When this is the action, the type of ~AuditLogEntry.target is the GuildSticker or Object with the ID of the sticker which was updated.

Possible attributes for AuditLogDiff:

  • ~AuditLogDiff.name
  • ~AuditLogDiff.emoji
  • ~AuditLogDiff.description

2.0

sticker_delete

A sticker was deleted.

When this is the action, the type of ~AuditLogEntry.target is the Object with the ID of the sticker which was deleted.

Possible attributes for AuditLogDiff:

  • ~AuditLogDiff.name
  • ~AuditLogDiff.emoji
  • ~AuditLogDiff.type
  • ~AuditLogDiff.format_type
  • ~AuditLogDiff.description
  • ~AuditLogDiff.available

2.0

thread_create

A thread was created.

When this is the action, the type of ~AuditLogEntry.target is the Thread or Object with the ID of the thread which was created.

Possible attributes for AuditLogDiff:

  • ~AuditLogDiff.name
  • ~AuditLogDiff.archived
  • ~AuditLogDiff.locked
  • ~AuditLogDiff.auto_archive_duration
  • ~AuditLogDiff.type
  • ~AuditLogDiff.slowmode_delay
  • ~AuditLogDiff.invitable
  • ~AuditLogDiff.flags
  • ~AuditLogDiff.applied_tags

2.0

thread_update

A thread was updated.

When this is the action, the type of ~AuditLogEntry.target is the Thread or Object with the ID of the thread which was updated.

Possible attributes for AuditLogDiff:

  • ~AuditLogDiff.name
  • ~AuditLogDiff.archived
  • ~AuditLogDiff.locked
  • ~AuditLogDiff.auto_archive_duration
  • ~AuditLogDiff.slowmode_delay
  • ~AuditLogDiff.invitable
  • ~AuditLogDiff.flags
  • ~AuditLogDiff.applied_tags

2.0

thread_delete

A thread was deleted.

When this is the action, the type of ~AuditLogEntry.target is the Object with the ID of the thread which was deleted.

Possible attributes for AuditLogDiff:

  • ~AuditLogDiff.name
  • ~AuditLogDiff.archived
  • ~AuditLogDiff.locked
  • ~AuditLogDiff.auto_archive_duration
  • ~AuditLogDiff.type
  • ~AuditLogDiff.slowmode_delay
  • ~AuditLogDiff.invitable
  • ~AuditLogDiff.flags
  • ~AuditLogDiff.applied_tags

2.0

application_command_permission_update

The permissions of an application command were updated.

When this is the action, the type of ~AuditLogEntry.target is the ApplicationCommand, PartialIntegration, or Object with the ID of the command whose permissions were updated or the application ID if these are application-wide permissions.

When this is the action, the type of ~AuditLogEntry.extra is set to an unspecified proxy object with one attribute:

  • integration: The PartialIntegration or Object with the application ID of the associated application.

Possible attributes for AuditLogDiff:

  • ~AuditLogDiff.command_permissions

2.5

2.6 Added support for PartialIntegration, and added integration to ~AuditLogEntry.extra.

automod_rule_create

An auto moderation rule was created.

When this is the action, the type of ~AuditLogEntry.target is the AutoModRule or Object with the ID of the auto moderation rule which was created.

Possible attributes for AuditLogDiff:

  • ~AuditLogDiff.name
  • ~AuditLogDiff.enabled
  • ~AuditLogDiff.trigger_type
  • ~AuditLogDiff.event_type
  • ~AuditLogDiff.actions
  • ~AuditLogDiff.trigger_metadata
  • ~AuditLogDiff.exempt_roles
  • ~AuditLogDiff.exempt_channels

2.6

automod_rule_update

An auto moderation rule was updated.

When this is the action, the type of ~AuditLogEntry.target is the AutoModRule or Object with the ID of the auto moderation rule which was updated.

Possible attributes for AuditLogDiff:

  • ~AuditLogDiff.name
  • ~AuditLogDiff.enabled
  • ~AuditLogDiff.trigger_type
  • ~AuditLogDiff.event_type
  • ~AuditLogDiff.actions
  • ~AuditLogDiff.trigger_metadata
  • ~AuditLogDiff.exempt_roles
  • ~AuditLogDiff.exempt_channels

2.6

automod_rule_delete

An auto moderation rule was deleted.

When this is the action, the type of ~AuditLogEntry.target is the Object with the ID of the auto moderation rule which was deleted.

Possible attributes for AuditLogDiff:

  • ~AuditLogDiff.name
  • ~AuditLogDiff.enabled
  • ~AuditLogDiff.trigger_type
  • ~AuditLogDiff.event_type
  • ~AuditLogDiff.actions
  • ~AuditLogDiff.trigger_metadata
  • ~AuditLogDiff.exempt_roles
  • ~AuditLogDiff.exempt_channels

2.6

automod_block_message

A message was blocked by an auto moderation rule.

When this is the action, the type of ~AuditLogEntry.target is the Member or User who had their message blocked. If the user is not found then it is a Object with the user's ID.

When this is the action, the type of ~AuditLogEntry.extra is set to an unspecified proxy object with these attributes:

  • channel: A abc.GuildChannel, Thread or Object with the channel ID where the message got blocked. May also be None.
  • rule_name: A str with the name of the rule that matched.
  • rule_trigger_type: An AutoModTriggerType value with the trigger type of the rule.

automod_send_alert_message

An alert message was sent by an auto moderation rule.

When this is the action, the type of ~AuditLogEntry.target is the Member or User who had their message flagged. If the user is not found then it is a Object with the user's ID.

See automod_block_message for more information on how the ~AuditLogEntry.extra field is set.

automod_timeout

A user was timed out by an auto moderation rule.

When this is the action, the type of ~AuditLogEntry.target is the Member or User who was timed out. If the user is not found then it is a Object with the user's ID.

See automod_block_message for more information on how the ~AuditLogEntry.extra field is set.

AuditLogActionCategory

Represents the category that the AuditLogAction belongs to.

This can be retrieved via AuditLogEntry.category.

create

The action is the creation of something.

delete

The action is the deletion of something.

update

The action is the update of something.

Events

  • on_audit_log_entry_create(entry) <disnake.on_audit_log_entry_create>