Skip to content

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.

entries class-attribute instance-attribute #

entries: Mapping[Snowflake, AuditLogEntry] = field(repr=False)

A mapping of snowflake IDs to the audit log's entries.

integrations class-attribute instance-attribute #

integrations: Mapping[Snowflake, PartialIntegration] = 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] = field(repr=False)

A mapping of the objects of threads found in this audit log.

users class-attribute instance-attribute #

users: Mapping[Snowflake, User] = field(repr=False)

A mapping of the objects of users found in this audit log.

webhooks class-attribute instance-attribute #

webhooks: Mapping[Snowflake, PartialWebhook] = field(repr=False)

A mapping of the objects of webhooks found in this audit log.

AuditLogChange #

Represents a change made to an audit log entry's target entity.

key class-attribute instance-attribute #

key: Union[AuditLogChangeKey, str] = field(repr=True)

The name of the audit log change's key.

new_value class-attribute instance-attribute #

new_value: Optional[Any] = field(repr=True)

The new value of the key, if something was added or changed.

old_value class-attribute instance-attribute #

old_value: Optional[Any] = field(repr=True)

The old value of the key, if something was removed or changed.

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.

AFK_TIMEOUT class-attribute instance-attribute #

AFK_TIMEOUT = 'afk_timeout'

Afk Timeout.

ALLOW class-attribute instance-attribute #

ALLOW = 'allow'

Allow.

APPLICATION_ID class-attribute instance-attribute #

APPLICATION_ID = 'application_id'

Application ID.

ARCHIVED class-attribute instance-attribute #

ARCHIVED = 'archived'

Archived.

ASSETS class-attribute instance-attribute #

ASSETS = 'asset'

Asset.

AUTO_ARCHIVE_DURATION class-attribute instance-attribute #

AUTO_ARCHIVE_DURATION = 'auto_archive_duration'

Auto Archive Duration.

AVAILABLE class-attribute instance-attribute #

AVAILABLE = 'available'

Available.

AVATAR_HASH class-attribute instance-attribute #

AVATAR_HASH = 'avatar_hash'

Avatar Hash.

BANNER_HASH class-attribute instance-attribute #

BANNER_HASH = 'banner_hash'

Banner Hash.

BITRATE class-attribute instance-attribute #

BITRATE = 'bitrate'

Bitrate.

CHANNEL_ID class-attribute instance-attribute #

CHANNEL_ID = 'channel_id'

Channel ID.

COLOR class-attribute instance-attribute #

COLOR = 'color'

Color.

COLOUR class-attribute instance-attribute #

COLOUR = COLOR

COMMAND_ID class-attribute instance-attribute #

COMMAND_ID = 'command_id'

Command ID.

DEAF class-attribute instance-attribute #

DEAF = 'deaf'

Deaf.

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.

DENY class-attribute instance-attribute #

DENY = 'deny'

Deny.

DESCRIPTION class-attribute instance-attribute #

DESCRIPTION = 'description'

Description.

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.

FORMAT_TYPE class-attribute instance-attribute #

FORMAT_TYPE = 'format_type'

Format Type.

GUILD_ID class-attribute instance-attribute #

GUILD_ID = 'guild_id'

Guild ID.

HOIST class-attribute instance-attribute #

HOIST = 'hoist'

Hoist.

ICON_HASH class-attribute instance-attribute #

ICON_HASH = 'icon_hash'

Icon Hash.

ID class-attribute instance-attribute #

ID = 'id'

ID.

INVITABLE class-attribute instance-attribute #

INVITABLE = 'invitable'

Invitable.

INVITER_ID class-attribute instance-attribute #

INVITER_ID = 'inviter_id'

Inviter ID.

INVITE_CODE class-attribute instance-attribute #

INVITE_CODE = 'code'

Code.

LOCKED class-attribute instance-attribute #

LOCKED = 'locked'

Locked.

MAX_AGE class-attribute instance-attribute #

MAX_AGE = 'max_age'

Max Age.

MAX_USES class-attribute instance-attribute #

MAX_USES = 'max_uses'

Max Uses.

MENTIONABLE class-attribute instance-attribute #

MENTIONABLE = 'mentionable'

Mentionable.

MFA_LEVEL class-attribute instance-attribute #

MFA_LEVEL = 'mfa_level'

Mfa Level.

MUTE class-attribute instance-attribute #

MUTE = 'mute'

Mute.

NAME class-attribute instance-attribute #

NAME = 'name'

Name.

NICK class-attribute instance-attribute #

NICK = 'nick'

Nick.

NSFW class-attribute instance-attribute #

NSFW = 'nsfw'

Nsfw.

OWNER_ID class-attribute instance-attribute #

OWNER_ID = 'owner_id'

Owner ID.

PERMISSIONS class-attribute instance-attribute #

PERMISSIONS = 'permissions'

Permissions.

PERMISSION_OVERWRITES class-attribute instance-attribute #

PERMISSION_OVERWRITES = 'permission_overwrites'

Permission Overwrites.

POSITION class-attribute instance-attribute #

POSITION = 'position'

Position.

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.

REGION class-attribute instance-attribute #

REGION = 'region'

Region.

REMOVE_ROLE_FROM_MEMBER class-attribute instance-attribute #

REMOVE_ROLE_FROM_MEMBER = '$remove'

Role removed from a member.

RTC_REGION class-attribute instance-attribute #

RTC_REGION = 'rtc_region'

RTC Region.

RULES_CHANNEL_ID class-attribute instance-attribute #

RULES_CHANNEL_ID = 'rules_channel_id'

Rules Channel ID.

SPLASH_HASH class-attribute instance-attribute #

SPLASH_HASH = 'splash_hash'

Splash Hash.

SYSTEM_CHANNEL_ID class-attribute instance-attribute #

SYSTEM_CHANNEL_ID = 'system_channel_id'

System Channel ID.

TAGS class-attribute instance-attribute #

TAGS = 'tags'

Tags.

TEMPORARY class-attribute instance-attribute #

TEMPORARY = 'temporary'

Temporary.

TOPIC class-attribute instance-attribute #

TOPIC = 'topic'

Topic.

TYPE class-attribute instance-attribute #

TYPE = 'type'

Type.

USER_LIMIT class-attribute instance-attribute #

USER_LIMIT = 'user_limit'

User Limit.

USES class-attribute instance-attribute #

USES = 'uses'

Uses.

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.

name property #

name: str

Return the name of the enum member as a str.

value property #

value

Return the value of the enum member.

AuditLogEntry #

Bases: Unique

Represents an entry in a guild's audit log.

action_type class-attribute instance-attribute #

action_type: Union[AuditLogEventType, int] = field(
    eq=False, hash=False, repr=True
)

The type of action this entry represents.

app class-attribute instance-attribute #

app: RESTAware = field(
    repr=False, eq=False, hash=False, metadata={SKIP_DEEP_COPY: True}
)

Client application that models may use for procedures.

changes class-attribute instance-attribute #

changes: Sequence[AuditLogChange] = field(eq=False, hash=False, repr=False)

A sequence of the changes made to hikari.audit_logs.AuditLogEntry.target_id.

created_at property #

created_at: datetime

When the object was created.

guild_id class-attribute instance-attribute #

guild_id: Snowflake = field(eq=False, hash=False, repr=True)

ID of the guild this audit log entry is for.

id class-attribute instance-attribute #

id: Snowflake = field(hash=True, repr=True)

The ID of this entity.

options class-attribute instance-attribute #

options: Optional[BaseAuditLogEntryInfo] = field(
    eq=False, hash=False, repr=False
)

Extra information about this entry. Only be provided for certain event_type.

reason class-attribute instance-attribute #

reason: Optional[str] = field(eq=False, hash=False, repr=False)

The reason for this change, if set (between 0-512 characters).

target_id class-attribute instance-attribute #

target_id: Optional[Snowflake] = field(eq=False, hash=False, repr=True)

The ID of the entity affected by this change, if applicable.

user_id class-attribute instance-attribute #

user_id: Optional[Snowflake] = field(eq=False, hash=False, repr=True)

The ID of the user who made this change.

fetch_user async #

fetch_user() -> Optional[User]

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 max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

AuditLogEventType #

Bases: int, Enum

The type of event that occurred.

name property #

name: str

Return the name of the enum member as a str.

value property #

value

Return the value of the enum member.

BaseAuditLogEntryInfo #

Bases: ABC

A base object that all audit log entry info objects will inherit from.

app class-attribute instance-attribute #

app: RESTAware = field(repr=False, eq=False, metadata={SKIP_DEEP_COPY: True})

Client application that models may use for procedures.

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.

app class-attribute instance-attribute #

app: RESTAware = field(repr=False, eq=False, metadata={SKIP_DEEP_COPY: True})

Client application that models may use for procedures.

created_at property #

created_at: datetime

When the object was created.

id class-attribute instance-attribute #

id: Snowflake = field(hash=True, repr=True)

The ID of this entity.

role_name class-attribute instance-attribute #

role_name: Optional[str] = field(repr=True)

The name of the role this overwrite targets, if it targets a role.

type class-attribute instance-attribute #

type: Union[PermissionOverwriteType, str] = field(repr=True)

The type of entity this overwrite targets.

MemberDisconnectEntryInfo #

Bases: BaseAuditLogEntryInfo

Extra information for the voice chat member disconnect entry.

app class-attribute instance-attribute #

app: RESTAware = field(repr=False, eq=False, metadata={SKIP_DEEP_COPY: True})

Client application that models may use for procedures.

count class-attribute instance-attribute #

count: int = field(repr=True)

The amount of members who were disconnected from voice in this entry.

MemberMoveEntryInfo #

Bases: MemberDisconnectEntryInfo

Extra information for the voice chat based member move entry.

app class-attribute instance-attribute #

app: RESTAware = field(repr=False, eq=False, metadata={SKIP_DEEP_COPY: True})

Client application that models may use for procedures.

channel_id class-attribute instance-attribute #

channel_id: Snowflake = field(repr=True)

The channel that the member(s) have been moved to.

count class-attribute instance-attribute #

count: int = field(repr=True)

The amount of members who were disconnected from voice in this entry.

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 hikari.permissions.Permissions.VIEW_CHANNEL permission in the channel.

NotFoundError

If the channel is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.

MemberPruneEntryInfo #

Bases: BaseAuditLogEntryInfo

Extra information attached to guild prune log entries.

app class-attribute instance-attribute #

app: RESTAware = field(repr=False, eq=False, metadata={SKIP_DEEP_COPY: True})

Client application that models may use for procedures.

delete_member_days class-attribute instance-attribute #

delete_member_days: timedelta = field(repr=True)

The timedelta of how many days members were pruned for inactivity based on.

members_removed class-attribute instance-attribute #

members_removed: int = field(repr=True)

The number of members who were removed by this prune.

MessageBulkDeleteEntryInfo #

Bases: BaseAuditLogEntryInfo

Extra information for the message bulk delete audit entry.

app class-attribute instance-attribute #

app: RESTAware = field(repr=False, eq=False, metadata={SKIP_DEEP_COPY: True})

Client application that models may use for procedures.

count class-attribute instance-attribute #

count: int = field(repr=True)

The amount of messages that were deleted.

MessageDeleteEntryInfo #

Bases: MessageBulkDeleteEntryInfo

Extra information attached to the message delete audit entry.

app class-attribute instance-attribute #

app: RESTAware = field(repr=False, eq=False, metadata={SKIP_DEEP_COPY: True})

Client application that models may use for procedures.

channel_id class-attribute instance-attribute #

channel_id: Snowflake = field(repr=True)

The ID of guild text based channel where these message(s) were deleted.

count class-attribute instance-attribute #

count: int = field(repr=True)

The amount of messages that 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 hikari.permissions.Permissions.VIEW_CHANNEL permission in the channel.

NotFoundError

If the channel is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

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.

app class-attribute instance-attribute #

app: RESTAware = field(repr=False, eq=False, metadata={SKIP_DEEP_COPY: True})

Client application that models may use for procedures.

channel_id class-attribute instance-attribute #

channel_id: Snowflake = field(repr=True)

The ID of the text based channel where a pinned message is being targeted.

message_id class-attribute instance-attribute #

message_id: Snowflake = field(repr=True)

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 hikari.permissions.Permissions.VIEW_CHANNEL permission in the channel.

NotFoundError

If the channel is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

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 hikari.permissions.Permissions.VIEW_CHANNEL permission in the channel that the message is in.

NotFoundError

If the message is not found.

RateLimitTooLongError

Raised in the event that a rate limit occurs that is longer than max_rate_limit when making a request.

InternalServerError

If an internal error occurs on Discord while handling the request.