hikari.audit_logs#
Application and entities that are used to describe audit logs on Discord.
AuditLog #
Bases: Sequence[AuditLogEntry]
Represents a guilds audit log's page.
auto_mod_rules class-attribute instance-attribute #
auto_mod_rules: Mapping[Snowflake, AutoModRule] = (
attrs.field(repr=False)
)
A mapping of auto-moderation rule objects referenced in this audit log.
entries class-attribute instance-attribute #
entries: Mapping[Snowflake, AuditLogEntry] = attrs.field(
repr=False
)
A mapping of snowflake IDs to the audit log's entries.
integrations class-attribute instance-attribute #
integrations: Mapping[Snowflake, PartialIntegration] = (
attrs.field(repr=False)
)
A mapping of the partial objects of integrations found in this audit log.
threads class-attribute instance-attribute #
threads: Mapping[Snowflake, GuildThreadChannel] = (
attrs.field(repr=False)
)
A mapping of the objects of threads found in this audit log.
users class-attribute instance-attribute #
A mapping of the objects of users found in this audit log.
AuditLogChange #
Represents a change made to an audit log entry's target entity.
AuditLogChangeKey #
Bases: str, Enum
Commonly known and documented keys for audit log change objects.
Others may exist. These should be expected to default to the raw string Discord provided us. These are defined for documentation purposes and can be treated as regular strings for all other purposes.
ADD_ROLE_TO_MEMBER class-attribute instance-attribute #
ADD_ROLE_TO_MEMBER = '$add'
Role added to a member.
AFK_CHANNEL_ID class-attribute instance-attribute #
AFK_CHANNEL_ID = 'afk_channel_id'
Afk Channel ID.
APPLICATION_ID class-attribute instance-attribute #
APPLICATION_ID = 'application_id'
Application ID.
AUTO_ARCHIVE_DURATION class-attribute instance-attribute #
AUTO_ARCHIVE_DURATION = 'auto_archive_duration'
Auto Archive Duration.
COLOUR class-attribute instance-attribute #
COLOUR = COLOR
Alias for hikari.audit_logs.AuditLogChangeKey.COLOR.
COLOURS class-attribute instance-attribute #
COLOURS = COLORS
Alias for hikari.audit_logs.AuditLogChangeKey.COLORS.
COMMUNICATION_DISABLED_UNTIL class-attribute instance-attribute #
COMMUNICATION_DISABLED_UNTIL = (
"communication_disabled_until"
)
The datetime when a timeout will expire.
DEFAULT_AUTO_ARCHIVE_DURATION class-attribute instance-attribute #
DEFAULT_AUTO_ARCHIVE_DURATION = (
"default_auto_archive_duration"
)
Default Auto Archive Duration.
DEFAULT_MESSAGE_NOTIFICATIONS class-attribute instance-attribute #
DEFAULT_MESSAGE_NOTIFICATIONS = (
"default_message_notifications"
)
Default Message Notifications.
DISCOVERY_SPLASH_HASH class-attribute instance-attribute #
DISCOVERY_SPLASH_HASH = 'discovery_splash_hash'
Discovery Splash Hash.
ENABLE_EMOTICONS class-attribute instance-attribute #
ENABLE_EMOTICONS = 'enable_emoticons'
Enable Emoticons.
EXPIRE_BEHAVIOR class-attribute instance-attribute #
EXPIRE_BEHAVIOR = 'expire_behavior'
Expire Behavior.
EXPIRE_GRACE_PERIOD class-attribute instance-attribute #
EXPIRE_GRACE_PERIOD = 'expire_grace_period'
Expire Grace Period.
EXPLICIT_CONTENT_FILTER class-attribute instance-attribute #
EXPLICIT_CONTENT_FILTER = 'explicit_content_filter'
Explicit Content Filter.
PERMISSION_OVERWRITES class-attribute instance-attribute #
PERMISSION_OVERWRITES = 'permission_overwrites'
Permission Overwrites.
PREFERRED_LOCALE class-attribute instance-attribute #
PREFERRED_LOCALE = 'preferred_locale'
Preferred Locale.
PRUNE_DELETE_DAYS class-attribute instance-attribute #
PRUNE_DELETE_DAYS = 'prune_delete_days'
Prune Delete Days.
PUBLIC_UPDATES_CHANNEL_ID class-attribute instance-attribute #
PUBLIC_UPDATES_CHANNEL_ID = 'public_updates_channel_id'
Public Updates Channel ID.
RATE_LIMIT_PER_USER class-attribute instance-attribute #
RATE_LIMIT_PER_USER = 'rate_limit_per_user'
Rate Limit Per User.
REMOVE_ROLE_FROM_MEMBER class-attribute instance-attribute #
REMOVE_ROLE_FROM_MEMBER = '$remove'
Role removed from a member.
RULES_CHANNEL_ID class-attribute instance-attribute #
RULES_CHANNEL_ID = 'rules_channel_id'
Rules Channel ID.
SYSTEM_CHANNEL_ID class-attribute instance-attribute #
SYSTEM_CHANNEL_ID = 'system_channel_id'
System Channel ID.
VANITY_URL_CODE class-attribute instance-attribute #
VANITY_URL_CODE = 'vanity_url_code'
Vanity Url Code.
VERIFICATION_LEVEL class-attribute instance-attribute #
VERIFICATION_LEVEL = 'verification_level'
Verification Level.
WIDGET_CHANNEL_ID class-attribute instance-attribute #
WIDGET_CHANNEL_ID = 'widget_channel_id'
Widget Channel ID.
WIDGET_ENABLED class-attribute instance-attribute #
WIDGET_ENABLED = 'widget_enabled'
Widget Enabled.
AuditLogEntry #
Bases: Unique
Represents an entry in a guild's audit log.
action_type class-attribute instance-attribute #
action_type: AuditLogEventType | int = attrs.field(
eq=False, hash=False, repr=True
)
The type of action this entry represents.
app class-attribute instance-attribute #
app: RESTAware = attrs.field(
repr=False,
eq=False,
hash=False,
metadata={attrs_extensions.SKIP_DEEP_COPY: True},
)
Client application that models may use for procedures.
changes class-attribute instance-attribute #
changes: Sequence[AuditLogChange] = attrs.field(
eq=False, hash=False, repr=False
)
A sequence of the changes made to hikari.audit_logs.AuditLogEntry.target_id.
guild_id class-attribute instance-attribute #
ID of the guild this audit log entry is for.
id class-attribute instance-attribute #
The ID of this entity.
options class-attribute instance-attribute #
options: BaseAuditLogEntryInfo | None = attrs.field(
eq=False, hash=False, repr=False
)
Extra information about this entry. Only be provided for certain event_type.
reason class-attribute instance-attribute #
The reason for this change, if set (between 0-512 characters).
target_id class-attribute instance-attribute #
The ID of the entity affected by this change, if applicable.
user_id class-attribute instance-attribute #
The ID of the user who made this change.
fetch_user async #
fetch_user() -> User | None
Fetch the user who made this change.
| RETURNS | DESCRIPTION |
|---|---|
Optional[User] | The user who made this change, if available. |
| RAISES | DESCRIPTION |
|---|---|
UnauthorizedError | If you are unauthorized to make the request (invalid/missing token). |
NotFoundError | If the user is not found. |
RateLimitTooLongError | Raised in the event that a rate limit occurs that is longer than |
InternalServerError | If an internal error occurs on Discord while handling the request. |
AuditLogEventType #
Bases: int, Enum
The type of event that occurred.
APPLICATION_COMMAND_PERMISSION_UPDATE class-attribute instance-attribute #
APPLICATION_COMMAND_PERMISSION_UPDATE = 121
Indicates that permissions were updated for a command.
AUTO_MODERATION_BLOCK_MESSAGE class-attribute instance-attribute #
AUTO_MODERATION_BLOCK_MESSAGE = 143
Indicates that a message was blocked by automod.
AUTO_MODERATION_FLAG_TO_CHANNEL class-attribute instance-attribute #
AUTO_MODERATION_FLAG_TO_CHANNEL = 144
Indicates that a message was flagged by automod.
AUTO_MODERATION_RULE_CREATE class-attribute instance-attribute #
AUTO_MODERATION_RULE_CREATE = 140
Indicates that an automod rule was created.
AUTO_MODERATION_RULE_DELETE class-attribute instance-attribute #
AUTO_MODERATION_RULE_DELETE = 142
Indicates that an automod rule was deleted.
AUTO_MODERATION_RULE_UPDATE class-attribute instance-attribute #
AUTO_MODERATION_RULE_UPDATE = 141
Indicates that an automod rule was updated.
AUTO_MODERATION_USER_COMMUNICATION_DISABLED class-attribute instance-attribute #
AUTO_MODERATION_USER_COMMUNICATION_DISABLED = 145
Indicates that a member was timed out by automod.
CHANNEL_CREATE class-attribute instance-attribute #
CHANNEL_CREATE = 10
Indicates that a channel was created.
CHANNEL_DELETE class-attribute instance-attribute #
CHANNEL_DELETE = 12
Indicates that a channel was deleted.
CHANNEL_OVERWRITE_CREATE class-attribute instance-attribute #
CHANNEL_OVERWRITE_CREATE = 13
Indicates that a permission overwrite was added to a channel.
CHANNEL_OVERWRITE_DELETE class-attribute instance-attribute #
CHANNEL_OVERWRITE_DELETE = 15
Indicates that a permission overwrite was deleted from a channel.
CHANNEL_OVERWRITE_UPDATE class-attribute instance-attribute #
CHANNEL_OVERWRITE_UPDATE = 14
Indicates that a permission overwrite was updated for a channel.
CHANNEL_UPDATE class-attribute instance-attribute #
CHANNEL_UPDATE = 11
Indicates that a channel's settings were updated.
CREATOR_MONETIZATION_REQUEST_CREATED class-attribute instance-attribute #
CREATOR_MONETIZATION_REQUEST_CREATED = 150
Indicates that creator monetization request was created.
CREATOR_MONETIZATION_TERMS_ACCEPTED class-attribute instance-attribute #
CREATOR_MONETIZATION_TERMS_ACCEPTED = 151
Indicates that creator monetization terms were accepted.
EMOJI_CREATE class-attribute instance-attribute #
EMOJI_CREATE = 60
Indicates that an emoji was created.
EMOJI_DELETE class-attribute instance-attribute #
EMOJI_DELETE = 62
Indicates that an emoji was deleted.
EMOJI_UPDATE class-attribute instance-attribute #
EMOJI_UPDATE = 61
Indicates that an emoji name was updated.
GUILD_SCHEDULED_EVENT_CREATE class-attribute instance-attribute #
GUILD_SCHEDULED_EVENT_CREATE = 100
Indicates that a guild event was created
GUILD_SCHEDULED_EVENT_DELETE class-attribute instance-attribute #
GUILD_SCHEDULED_EVENT_DELETE = 102
Indicates thata guild event was cancelled.
GUILD_SCHEDULED_EVENT_UPDATE class-attribute instance-attribute #
GUILD_SCHEDULED_EVENT_UPDATE = 101
Indicates that a guild event was updated.
GUILD_UPDATE class-attribute instance-attribute #
GUILD_UPDATE = 1
Indicates that guild settings were updated.
HOME_SETTINGS_CREATE class-attribute instance-attribute #
HOME_SETTINGS_CREATE = 190
Indicates that guild server guide was created.
HOME_SETTINGS_UPDATE class-attribute instance-attribute #
HOME_SETTINGS_UPDATE = 191
Indicates that guild server guide was updated.
INTEGRATION_CREATE class-attribute instance-attribute #
INTEGRATION_CREATE = 80
Indicates that an app was added to guild.
INTEGRATION_DELETE class-attribute instance-attribute #
INTEGRATION_DELETE = 82
Indicates that an app was removed from guild.
INTEGRATION_UPDATE class-attribute instance-attribute #
INTEGRATION_UPDATE = 81
Indicates that an app was updated (i.e., it's scopes were updated).
INVITE_CREATE class-attribute instance-attribute #
INVITE_CREATE = 40
Indicates that a guild invite was created.
INVITE_DELETE class-attribute instance-attribute #
INVITE_DELETE = 42
Indicates that a guild invite was deleted.
INVITE_UPDATE class-attribute instance-attribute #
INVITE_UPDATE = 41
Indicates that a guild invite was updated.
MEMBER_BAN_ADD class-attribute instance-attribute #
MEMBER_BAN_ADD = 22
Indicates that a member was banned from guild.
MEMBER_BAN_REMOVE class-attribute instance-attribute #
MEMBER_BAN_REMOVE = 23
Indicates that guild ban was lifted for a member.
MEMBER_DISCONNECT class-attribute instance-attribute #
MEMBER_DISCONNECT = 27
Indicates that a member was disconnected from a voice channel.
MEMBER_KICK class-attribute instance-attribute #
MEMBER_KICK = 20
Indicates that a member was kicked from guild.
MEMBER_MOVE class-attribute instance-attribute #
MEMBER_MOVE = 26
Indicates that a member was moved to a different voice channel.
MEMBER_PRUNE class-attribute instance-attribute #
MEMBER_PRUNE = 21
Indicates that members were pruned from guild.
MEMBER_ROLE_UPDATE class-attribute instance-attribute #
MEMBER_ROLE_UPDATE = 25
Indicates that a member was added or removed from a role.
MEMBER_UPDATE class-attribute instance-attribute #
MEMBER_UPDATE = 24
Indicates that a member was updated in guild.
MESSAGE_BULK_DELETE class-attribute instance-attribute #
MESSAGE_BULK_DELETE = 73
Indicates that multiple messages were deleted.
MESSAGE_DELETE class-attribute instance-attribute #
MESSAGE_DELETE = 72
Indicates that a single message was deleted.
MESSAGE_PIN class-attribute instance-attribute #
MESSAGE_PIN = 74
Indicates that a message was pinned to a channel.
MESSAGE_UNPIN class-attribute instance-attribute #
MESSAGE_UNPIN = 75
Indicates that a message was unpinned from a channel.
ONBOARDING_CREATE class-attribute instance-attribute #
ONBOARDING_CREATE = 166
Indicates that guild onboarding was created.
ONBOARDING_PROMPT_CREATE class-attribute instance-attribute #
ONBOARDING_PROMPT_CREATE = 163
Indicates that a guild onboarding question was created.
ONBOARDING_PROMPT_DELETE class-attribute instance-attribute #
ONBOARDING_PROMPT_DELETE = 165
Indicates that a guild onboarding question was deleted.
ONBOARDING_PROMPT_UPDATE class-attribute instance-attribute #
ONBOARDING_PROMPT_UPDATE = 164
Indicates that a guild onboarding question was updated.
ONBOARDING_UPDATE class-attribute instance-attribute #
ONBOARDING_UPDATE = 167
Indicates that guild onboarding was updated.
ROLE_CREATE class-attribute instance-attribute #
ROLE_CREATE = 30
Indicates that a role was created.
ROLE_DELETE class-attribute instance-attribute #
ROLE_DELETE = 32
Indicates that a role was deleted.
SOUNDBOARD_SOUND_CREATE class-attribute instance-attribute #
SOUNDBOARD_SOUND_CREATE = 130
Indicates that a soundboard sound was created.
SOUNDBOARD_SOUND_DELETE class-attribute instance-attribute #
SOUNDBOARD_SOUND_DELETE = 132
Indicates that a soundboard sound was deleted.
SOUNDBOARD_SOUND_UPDATE class-attribute instance-attribute #
SOUNDBOARD_SOUND_UPDATE = 131
Indicates that a soundboard sound was updated
STAGE_INSTANCE_CREATE class-attribute instance-attribute #
STAGE_INSTANCE_CREATE = 83
Indicates that a stage instance was created (stage channel went live).
STAGE_INSTANCE_DELETE class-attribute instance-attribute #
STAGE_INSTANCE_DELETE = 85
Indicates that a stage instance was deleted (stage channel no longer live).
STAGE_INSTANCE_UPDATE class-attribute instance-attribute #
STAGE_INSTANCE_UPDATE = 84
Indicates that a stage instance's details were updated.
STICKER_CREATE class-attribute instance-attribute #
STICKER_CREATE = 90
Indicates that a sticker was created.
STICKER_DELETE class-attribute instance-attribute #
STICKER_DELETE = 92
Indicates that a sticker was deleted.
STICKER_UPDATE class-attribute instance-attribute #
STICKER_UPDATE = 91
Indicates that a sticker's details were updated.
THREAD_CREATE class-attribute instance-attribute #
THREAD_CREATE = 110
Indicates that a thread was created in a channel.
THREAD_DELETE class-attribute instance-attribute #
THREAD_DELETE = 112
Indicates that a thread was deleted.
THREAD_UPDATE class-attribute instance-attribute #
THREAD_UPDATE = 111
Indicates that a thread was updated.
WEBHOOK_CREATE class-attribute instance-attribute #
WEBHOOK_CREATE = 50
Indicates that a webhook was created.
WEBHOOK_DELETE class-attribute instance-attribute #
WEBHOOK_DELETE = 52
Indicates that a webhook was deleted.
WEBHOOK_UPDATE class-attribute instance-attribute #
WEBHOOK_UPDATE = 51
Indicates that a webhook properties or channel were updated.
BaseAuditLogEntryInfo #
ChannelOverwriteEntryInfo #
Bases: BaseAuditLogEntryInfo, Unique
Represents the extra information for overwrite related audit log entries.
Will be attached to the overwrite create, update and delete audit log entries.
id class-attribute instance-attribute #
The ID of this entity.
role_name class-attribute instance-attribute #
The name of the role this overwrite targets, if it targets a role.
type class-attribute instance-attribute #
type: PermissionOverwriteType | int = attrs.field(repr=True)
The type of entity this overwrite targets.
MemberDisconnectEntryInfo #
Bases: BaseAuditLogEntryInfo
Extra information for the voice chat member disconnect entry.
MemberMoveEntryInfo #
Bases: MemberDisconnectEntryInfo
Extra information for the voice chat based member move entry.
channel_id class-attribute instance-attribute #
The channel that the member(s) have been moved to.
fetch_channel async #
fetch_channel() -> GuildVoiceChannel
Fetch the guild voice based channel where the member(s) have been moved to.
| RETURNS | DESCRIPTION |
|---|---|
GuildVoiceChannel | The guild voice based channel where the member(s) have been moved to. |
| RAISES | DESCRIPTION |
|---|---|
UnauthorizedError | If you are unauthorized to make the request (invalid/missing token). |
ForbiddenError | If you are missing the |
NotFoundError | If the channel is not found. |
RateLimitTooLongError | Raised in the event that a rate limit occurs that is longer than |
InternalServerError | If an internal error occurs on Discord while handling the request. |
MemberPruneEntryInfo #
Bases: BaseAuditLogEntryInfo
Extra information attached to guild prune log entries.
delete_member_days class-attribute instance-attribute #
The timedelta of how many days members were pruned for inactivity based on.
MessageBulkDeleteEntryInfo #
Bases: BaseAuditLogEntryInfo
Extra information for the message bulk delete audit entry.
MessageDeleteEntryInfo #
Bases: MessageBulkDeleteEntryInfo
Extra information attached to the message delete audit entry.
channel_id class-attribute instance-attribute #
The ID of guild text based channel where these message(s) were deleted.
fetch_channel async #
fetch_channel() -> TextableGuildChannel
Fetch the guild text based channel where these message(s) were deleted.
| RETURNS | DESCRIPTION |
|---|---|
TextableGuildChannel | The guild text based channel where these message(s) were deleted. |
| RAISES | DESCRIPTION |
|---|---|
UnauthorizedError | If you are unauthorized to make the request (invalid/missing token). |
ForbiddenError | If you are missing the |
NotFoundError | If the channel is not found. |
RateLimitTooLongError | Raised in the event that a rate limit occurs that is longer than |
InternalServerError | If an internal error occurs on Discord while handling the request. |
MessagePinEntryInfo #
Bases: BaseAuditLogEntryInfo
The extra information for message pin related audit log entries.
Will be attached to the message pin and message unpin audit log entries.
channel_id class-attribute instance-attribute #
The ID of the text based channel where a pinned message is being targeted.
message_id class-attribute instance-attribute #
The ID of the message that's being pinned or unpinned.
fetch_channel async #
fetch_channel() -> TextableChannel
Fetch The channel where this message was pinned or unpinned.
| RETURNS | DESCRIPTION |
|---|---|
TextableChannel | The channel where this message was pinned or unpinned. |
| RAISES | DESCRIPTION |
|---|---|
UnauthorizedError | If you are unauthorized to make the request (invalid/missing token). |
ForbiddenError | If you are missing the |
NotFoundError | If the channel is not found. |
RateLimitTooLongError | Raised in the event that a rate limit occurs that is longer than |
InternalServerError | If an internal error occurs on Discord while handling the request. |
fetch_message async #
fetch_message() -> Message
Fetch the object of the message that's being pinned or unpinned.
| RETURNS | DESCRIPTION |
|---|---|
Message | The message that's being pinned or unpinned. |
| RAISES | DESCRIPTION |
|---|---|
UnauthorizedError | If you are unauthorized to make the request (invalid/missing token). |
ForbiddenError | If you are missing the |
NotFoundError | If the message is not found. |
RateLimitTooLongError | Raised in the event that a rate limit occurs that is longer than |
InternalServerError | If an internal error occurs on Discord while handling the request. |