Audit-Log Models#
New in version 4.3.0.
- class interactions.api.models.audit_log.AuditLogEntry(kwargs_dict=None, /, **other_kwargs)[source]#
A class object representing an AuditLogEntry.
- Variables:
target_id (Optional[str]) – ID of the affected entity (webhook, user, role, etc.)
changes (Optional[List[AuditLogChange]]) – Changes made to the target_id
user_id (Optional[Snowflake]) – User or app that made the changes
id (Snowflake) – ID of the entry
action_type (AuditLogEvents) – Type of action that occurred
options (OptionalAuditEntryInfo) – Additional info for certain event types
reason (str) – Reason for the change (1-512 characters)
- enum interactions.api.models.audit_log.AuditLogEvents(value)[source]#
A class object representing the different types of AuditLogEvents.
Note
There is no official name for AuditLogEvents type 151, however it does represent the server owner sets up the guild for monetization/server subscriptions.
- Variables:
GUILD_UPDATE (int) – 1 - Server settings were updated
CHANNEL_CREATE (int) – 10 - Channel was created
CHANNEL_UPDATE (int) – 11 - Channel settings were updated
CHANNEL_DELETE (int) – 12 - Channel was deleted
CHANNEL_OVERWRITE_CREATE (int) – 13 - Permission overwrite was added to a channel
CHANNEL_OVERWRITE_UPDATE (int) – 14 - Permission overwrite was updated for a channel
CHANNEL_OVERWRITE_DELETE (int) – 15 - Permission overwrite was deleted from a channel
MEMBER_KICK (int) – 20 - Member was removed from server
MEMBER_PRUNE (int) – 21 - Members were pruned from server
MEMBER_BAN_ADD (int) – 22 - Member was banned from server
MEMBER_BAN_REMOVE (int) – 23 - Server ban was lifted for a member
MEMBER_UPDATE (int) – 24 - Member was updated in server
MEMBER_ROLE_UPDATE (int) – 25 - Member was added or removed from a role
MEMBER_MOVE (int) – 26 - Member was moved to a different voice channel
MEMBER_DISCONNECT (int) – 27 - Member was disconnected from a voice channel
BOT_ADD (int) – 28 - Bot user was added to server
ROLE_CREATE (int) – 30 - Role was created
ROLE_UPDATE (int) – 31 - Role was updated
ROLE_DELETE (int) – 32 - Role was deleted
INVITE_CREATE (int) – 40 - Server invite was created
INVITE_UPDATE (int) – 41 - Server invite was updated
INVITE_DELETE (int) – 42 - Server invite was deleted
WEBHOOK_CREATE (int) – 50 - Webhook was created
WEBHOOK_UPDATE (int) – 51 - Webhook properties or channel were updated
WEBHOOK_DELETE (int) – 52 - Webhook was deleted
EMOJI_CREATE (int) – 60 - Emoji was created
EMOJI_UPDATE (int) – 61 - Emoji name was updated
EMOJI_DELETE (int) – 62 - Emoji was deleted
MESSAGE_DELETE (int) – 72 - Single message was deleted
MESSAGE_BULK_DELETE (int) – 73 - Multiple messages were deleted
MESSAGE_PIN (int) – 74 - Message was pinned to a channel
MESSAGE_UNPIN (int) – 75 - Message was unpinned from a channel
INTEGRATION_CREATE (int) – 80 - App was added to server
INTEGRATION_UPDATE (int) – 81 - App was updated (as an example, its scopes were updated)
INTEGRATION_DELETE (int) – 82 - App was removed from server
STAGE_INSTANCE_CREATE (int) – 83 - Stage instance was created (stage channel becomes live)
STAGE_INSTANCE_UPDATE (int) – 84 - Stage instance details were updated
STAGE_INSTANCE_DELETE (int) – 85 - Stage instance was deleted (stage channel no longer live)
STICKER_CREATE (int) – 90 - Sticker was created
STICKER_UPDATE (int) – 91 - Sticker details were updated
STICKER_DELETE (int) – 92 - Sticker was deleted
GUILD_SCHEDULED_EVENT_CREATE (int) – 100 - Event was created
GUILD_SCHEDULED_EVENT_UPDATE (int) – 101 - Event was updated
GUILD_SCHEDULED_EVENT_DELETE (int) – 102 - Event was cancelled
THREAD_CREATE (int) – 110 - Thread was created in a channel
THREAD_UPDATE (int) – 111 - Thread was updated
THREAD_DELETE (int) – 112 - Thread was deleted
APPLICATION_COMMAND_PERMISSION_UPDATE (int) – 121 - Permissions were updated for a command
AUTO_MODERATION_RULE_CREATE (int) – 140 - Auto Moderation rule was created
AUTO_MODERATION_RULE_UPDATE (int) – 141 - Auto Moderation rule was updated
AUTO_MODERATION_RULE_DELETE (int) – 142 - Auto Moderation rule was deleted
AUTO_MODERATION_BLOCK_MESSAGE (int) – 143 - Message was blocked by AutoMod (according to a rule)
AUTO_MODERATION_FLAG_TO_CHANNEL (int) – 144 - Message was flagged by AutoMod (according to a rule)
AUTO_MODERATION_USER_COMMUNICATION_DISABLED (int) – 145 - Member was timed out by AutoMod (according to a rule)
GUILD_MONETIZATION_SETUP (int) – 151 - Monetization was set up in the server.
- Member Type:
Valid values are as follows:
- GUILD_UPDATE = <AuditLogEvents.GUILD_UPDATE: 1>#
- CHANNEL_CREATE = <AuditLogEvents.CHANNEL_CREATE: 10>#
- CHANNEL_UPDATE = <AuditLogEvents.CHANNEL_UPDATE: 11>#
- CHANNEL_DELETE = <AuditLogEvents.CHANNEL_DELETE: 12>#
- CHANNEL_OVERWRITE_CREATE = <AuditLogEvents.CHANNEL_OVERWRITE_CREATE: 13>#
- CHANNEL_OVERWRITE_UPDATE = <AuditLogEvents.CHANNEL_OVERWRITE_UPDATE: 14>#
- CHANNEL_OVERWRITE_DELETE = <AuditLogEvents.CHANNEL_OVERWRITE_DELETE: 15>#
- MEMBER_KICK = <AuditLogEvents.MEMBER_KICK: 20>#
- MEMBER_PRUNE = <AuditLogEvents.MEMBER_PRUNE: 21>#
- MEMBER_BAN_ADD = <AuditLogEvents.MEMBER_BAN_ADD: 22>#
- MEMBER_BAN_REMOVE = <AuditLogEvents.MEMBER_BAN_REMOVE: 23>#
- MEMBER_UPDATE = <AuditLogEvents.MEMBER_UPDATE: 24>#
- MEMBER_ROLE_UPDATE = <AuditLogEvents.MEMBER_ROLE_UPDATE: 25>#
- MEMBER_MOVE = <AuditLogEvents.MEMBER_MOVE: 26>#
- MEMBER_DISCONNECT = <AuditLogEvents.MEMBER_DISCONNECT: 27>#
- BOT_ADD = <AuditLogEvents.BOT_ADD: 28>#
- ROLE_CREATE = <AuditLogEvents.ROLE_CREATE: 30>#
- ROLE_UPDATE = <AuditLogEvents.ROLE_UPDATE: 31>#
- ROLE_DELETE = <AuditLogEvents.ROLE_DELETE: 32>#
- INVITE_CREATE = <AuditLogEvents.INVITE_CREATE: 40>#
- INVITE_UPDATE = <AuditLogEvents.INVITE_UPDATE: 41>#
- INVITE_DELETE = <AuditLogEvents.INVITE_DELETE: 42>#
- WEBHOOK_CREATE = <AuditLogEvents.WEBHOOK_CREATE: 50>#
- WEBHOOK_UPDATE = <AuditLogEvents.WEBHOOK_UPDATE: 51>#
- WEBHOOK_DELETE = <AuditLogEvents.WEBHOOK_DELETE: 52>#
- EMOJI_CREATE = <AuditLogEvents.EMOJI_CREATE: 60>#
- EMOJI_UPDATE = <AuditLogEvents.EMOJI_UPDATE: 61>#
- EMOJI_DELETE = <AuditLogEvents.EMOJI_DELETE: 62>#
- MESSAGE_DELETE = <AuditLogEvents.MESSAGE_DELETE: 72>#
- MESSAGE_BULK_DELETE = <AuditLogEvents.MESSAGE_BULK_DELETE: 73>#
- MESSAGE_PIN = <AuditLogEvents.MESSAGE_PIN: 74>#
- MESSAGE_UNPIN = <AuditLogEvents.MESSAGE_UNPIN: 75>#
- INTEGRATION_CREATE = <AuditLogEvents.INTEGRATION_CREATE: 80>#
- INTEGRATION_UPDATE = <AuditLogEvents.INTEGRATION_UPDATE: 81>#
- INTEGRATION_DELETE = <AuditLogEvents.INTEGRATION_DELETE: 82>#
- STAGE_INSTANCE_CREATE = <AuditLogEvents.STAGE_INSTANCE_CREATE: 83>#
- STAGE_INSTANCE_UPDATE = <AuditLogEvents.STAGE_INSTANCE_UPDATE: 84>#
- STAGE_INSTANCE_DELETE = <AuditLogEvents.STAGE_INSTANCE_DELETE: 85>#
- STICKER_CREATE = <AuditLogEvents.STICKER_CREATE: 90>#
- STICKER_UPDATE = <AuditLogEvents.STICKER_UPDATE: 91>#
- STICKER_DELETE = <AuditLogEvents.STICKER_DELETE: 92>#
- GUILD_SCHEDULED_EVENT_CREATE = <AuditLogEvents.GUILD_SCHEDULED_EVENT_CREATE: 100>#
- GUILD_SCHEDULED_EVENT_UPDATE = <AuditLogEvents.GUILD_SCHEDULED_EVENT_UPDATE: 101>#
- GUILD_SCHEDULED_EVENT_DELETE = <AuditLogEvents.GUILD_SCHEDULED_EVENT_DELETE: 102>#
- THREAD_CREATE = <AuditLogEvents.THREAD_CREATE: 110>#
- THREAD_UPDATE = <AuditLogEvents.THREAD_UPDATE: 111>#
- THREAD_DELETE = <AuditLogEvents.THREAD_DELETE: 112>#
- APPLICATION_COMMAND_PERMISSION_UPDATE = <AuditLogEvents.APPLICATION_COMMAND_PERMISSION_UPDATE: 121>#
- AUTO_MODERATION_RULE_CREATE = <AuditLogEvents.AUTO_MODERATION_RULE_CREATE: 140>#
- AUTO_MODERATION_RULE_UPDATE = <AuditLogEvents.AUTO_MODERATION_RULE_UPDATE: 141>#
- AUTO_MODERATION_RULE_DELETE = <AuditLogEvents.AUTO_MODERATION_RULE_DELETE: 142>#
- AUTO_MODERATION_BLOCK_MESSAGE = <AuditLogEvents.AUTO_MODERATION_BLOCK_MESSAGE: 143>#
- AUTO_MODERATION_FLAG_TO_CHANNEL = <AuditLogEvents.AUTO_MODERATION_FLAG_TO_CHANNEL: 144>#
- AUTO_MODERATION_USER_COMMUNICATION_DISABLED = <AuditLogEvents.AUTO_MODERATION_USER_COMMUNICATION_DISABLED: 145>#
- GUILD_MONETIZATION_SETUP = <AuditLogEvents.GUILD_MONETIZATION_SETUP: 151>#
- class interactions.api.models.audit_log.AuditLogs(kwargs_dict=None, /, **other_kwargs)[source]#
A class object representing the audit logs of a guild.
- Variables:
audit_log_entries (List[AuditLogEntry]) – List of audit log entries, sorted from most to least recent.
auto_moderation_rules (List[AutoModerationRule]) – List of auto moderation rules referenced in the audit log.
guild_scheduled_events (List[ScheduledEvents]) – List of guild scheduled events referenced in the audit log
integrations (List[Integration]) – List of partial integration objects
threads (List[Channel]) – List of threads referenced in the audit log
users (List[User]) – List of users referenced in the audit log
webhooks (List[Webhook]) – List of webhooks referenced in the audit log
- class interactions.api.models.audit_log.AuditLogChange(kwargs_dict=None, /, **other_kwargs)[source]#
A class object representing an AuditLogChange.
- Variables:
new_value (Optional[_T]) – New value of the key
old_value (Optional[_T]) – Old value of the key
key (str) – Name of the changed entity, with a few exceptions
- class interactions.api.models.audit_log.OptionalAuditEntryInfo(kwargs_dict=None, /, **other_kwargs)[source]#
A class object representing OptionalAuditEntryInfo.
- Variables:
application_id (Snowflake) – ID of the app whose permissions were targeted. Used in event
AuditLogEvents.APPLICATION_COMMAND_PERMISSION_UPDATE
.auto_moderation_rule_name (str) – Name of the Auto Moderation rule that was triggered. Used in events
AuditLogEvents.AUTO_MODERATION_BLOCK_MESSAGE
,AuditLogEvents.AUTO_MODERATION_FLAG_TO_CHANNEL
&AuditLogEvents.AUTO_MODERATION_USER_COMMUNICATION_DISABLED
.auto_moderation_rule_trigger_type (str) – Trigger type of the Auto Moderation rule that was triggered. Used in events
AuditLogEvents.AUTO_MODERATION_BLOCK_MESSAGE
,AuditLogEvents.AUTO_MODERATION_FLAG_TO_CHANNEL
&AuditLogEvents.AUTO_MODERATION_USER_COMMUNICATION_DISABLED
.channel_id (Snowflake) – Channel in which the entities were targeted. Used in events
AuditLogEvents.MEMBER_MOVE
,AuditLogEvents.MESSAGE_PIN
,AuditLogEvents.MESSAGE_UNPIN
,AuditLogEvents.MESSAGE_DELETE
,AuditLogEvents.STAGE_INSTANCE_CREATE
,AuditLogEvents.STAGE_INSTANCE_UPDATE
,AuditLogEvents.STAGE_INSTANCE_DELETE
,AuditLogEvents.AUTO_MODERATION_BLOCK_MESSAGE
,AuditLogEvents.AUTO_MODERATION_FLAG_TO_CHANNEL
&AuditLogEvents.AUTO_MODERATION_USER_COMMUNICATION_DISABLED
.count (str) – Number of entities that were targeted. Used in events
AuditLogEvents.MESSAGE_DELETE
,AuditLogEvents.MESSAGE_BULK_DELETE
,AuditLogEvents.MEMBER_DISCONNECT
&AuditLogEvents.MEMBER_MOVE
delete_member_days (str) – Number of days after which inactive members were kicked. Used in event
AuditLogEvents.MEMBER_PRUNE
id (Snowflake) – ID of the overwritten entity. Used in events
AuditLogEvents.CHANNEL_OVERWRITE_CREATE
,AuditLogEvents.CHANNEL_OVERWRITE_UPDATE
&AuditLogEvents.CHANNEL_OVERWRITE_DELETE
members_removed (str) – Number of members removed by the prune. Used in event
AuditLogEvents.MEMBER_PRUNE
message_id (Snowflake) – ID of the message that was targeted. Used in events
AuditLogEvents.MESSAGE_PIN
&AuditLogEvents.MESSAGE_UNPIN
role_name (Optional[str]) – Name of the role if type is “0” (not present if type is “1”). Used in events
AuditLogEvents.CHANNEL_OVERWRITE_CREATE
,AuditLogEvents.CHANNEL_OVERWRITE_UPDATE
&AuditLogEvents.CHANNEL_OVERWRITE_DELETE
type (str) – Type of overwritten entity - role (“0”) or member (“1”). Used in events
AuditLogEvents.CHANNEL_OVERWRITE_CREATE
,AuditLogEvents.CHANNEL_OVERWRITE_UPDATE
&AuditLogEvents.CHANNEL_OVERWRITE_DELETE