Enum twilight_model::guild::audit_log::AuditLogChange

source ·
#[non_exhaustive]
pub enum AuditLogChange {
Show 74 variants AfkChannelId { new: Option<Id<ChannelMarker>>, old: Option<Id<ChannelMarker>>, }, AfkTimeout { new: u64, old: u64, }, Allow { new: Option<Permissions>, old: Option<Permissions>, }, ApplicationId { new: Option<Id<ApplicationMarker>>, old: Option<Id<ApplicationMarker>>, }, Archived { new: Option<bool>, old: Option<bool>, }, Asset { new: Option<String>, old: Option<String>, }, AutoArchiveDuration { new: Option<AutoArchiveDuration>, old: Option<AutoArchiveDuration>, }, Available { new: Option<bool>, old: Option<bool>, }, AvatarHash { new: Option<ImageHash>, old: Option<ImageHash>, }, BannerHash { new: Option<ImageHash>, old: Option<ImageHash>, }, Bitrate { new: Option<u64>, old: Option<u64>, }, ChannelId { new: Option<Id<ChannelMarker>>, old: Option<Id<ChannelMarker>>, }, Code { new: Option<String>, old: Option<String>, }, Color { new: Option<u64>, old: Option<u64>, }, CommandId { new: Option<GuildCommandPermissions>, old: Option<GuildCommandPermissions>, }, CommunicationDisabledUntil { new: Option<Timestamp>, old: Option<Timestamp>, }, Deaf { new: Option<bool>, old: Option<bool>, }, DefaultAutoArchiveDuration { new: Option<AutoArchiveDuration>, old: Option<AutoArchiveDuration>, }, DefaultMessageNotifications { new: Option<DefaultMessageNotificationLevel>, old: Option<DefaultMessageNotificationLevel>, }, Deny { new: Option<Permissions>, old: Option<Permissions>, }, Description { new: Option<String>, old: Option<String>, }, DiscoverySplashHash { new: Option<ImageHash>, old: Option<ImageHash>, }, EnableEmoticons { new: Option<bool>, old: Option<bool>, }, EntityType { new: Option<u64>, old: Option<u64>, }, ExpireBehavior { new: Option<u64>, old: Option<u64>, }, ExpireGracePeriod { new: Option<u64>, old: Option<u64>, }, ExplicitContentFilter { new: Option<ExplicitContentFilter>, old: Option<ExplicitContentFilter>, }, FormatType { new: Option<StickerFormatType>, old: Option<StickerFormatType>, }, GuildId { new: Option<Id<GuildMarker>>, old: Option<Id<GuildMarker>>, }, Hoist { new: Option<bool>, old: Option<bool>, }, IconHash { new: Option<ImageHash>, old: Option<ImageHash>, }, Id { new: Option<Id<GenericMarker>>, old: Option<Id<GenericMarker>>, }, ImageHash { new: Option<ImageHash>, old: Option<ImageHash>, }, Invitable { new: Option<bool>, old: Option<bool>, }, InviterId { new: Option<Id<UserMarker>>, old: Option<Id<UserMarker>>, }, Location { new: Option<String>, old: Option<String>, }, Locked { new: Option<bool>, old: Option<bool>, }, MaxAge { new: Option<u64>, old: Option<u64>, }, MaxUses { new: Option<u64>, old: Option<u64>, }, Mentionable { new: Option<bool>, old: Option<bool>, }, MfaLevel { new: Option<MfaLevel>, old: Option<MfaLevel>, }, Mute { new: Option<bool>, old: Option<bool>, }, Name { new: Option<String>, old: Option<String>, }, Nick { new: Option<String>, old: Option<String>, }, Nsfw { new: Option<bool>, old: Option<bool>, }, NsfwLevel { new: Option<NSFWLevel>, old: Option<NSFWLevel>, }, OwnerId { new: Option<Id<UserMarker>>, old: Option<Id<UserMarker>>, }, PermissionOverwrites { new: Option<Vec<PermissionOverwrite>>, old: Option<Vec<PermissionOverwrite>>, }, Permissions { new: Option<Permissions>, old: Option<Permissions>, }, Position { new: Option<u64>, old: Option<u64>, }, PreferredLocale { new: Option<String>, old: Option<String>, }, PrivacyLevel { new: Option<PrivacyLevel>, old: Option<PrivacyLevel>, }, PruneDeleteDays { new: Option<u64>, old: Option<u64>, }, PublicUpdatesChannelId { new: Option<Id<ChannelMarker>>, old: Option<Id<ChannelMarker>>, }, RateLimitPerUser { new: Option<u64>, old: Option<u64>, }, Region { new: Option<String>, old: Option<String>, }, RoleAdded { new: Vec<AffectedRole>, old: Vec<AffectedRole>, }, RoleRemoved { new: Vec<AffectedRole>, old: Vec<AffectedRole>, }, RulesChannelId { new: Option<Id<ChannelMarker>>, old: Option<Id<ChannelMarker>>, }, SplashHash { new: Option<ImageHash>, old: Option<ImageHash>, }, Status { new: Option<u64>, old: Option<u64>, }, SystemChannelId { new: Option<Id<ChannelMarker>>, old: Option<Id<ChannelMarker>>, }, Tags { new: Option<String>, old: Option<String>, }, Temporary { new: Option<bool>, old: Option<bool>, }, Topic { new: Option<String>, old: Option<String>, }, Type { new: Option<AuditLogChangeTypeValue>, old: Option<AuditLogChangeTypeValue>, }, UnicodeEmoji { new: Option<String>, old: Option<String>, }, UserLimit { new: Option<u64>, old: Option<u64>, }, Uses { new: Option<u64>, old: Option<u64>, }, VanityUrlCode { new: Option<String>, old: Option<String>, }, VerificationLevel { new: Option<VerificationLevel>, old: Option<VerificationLevel>, }, WidgetChannelId { new: Option<Id<ChannelMarker>>, old: Option<Id<ChannelMarker>>, }, WidgetEnabled { new: Option<bool>, old: Option<bool>, }, Other,
}
Expand description

Individual change within an AuditLogEntry.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

AfkChannelId

AFK channel ID was changed.

Fields

§new: Option<Id<ChannelMarker>>

New ID of the AFK channel.

§old: Option<Id<ChannelMarker>>

Old ID of the AFK channel.

§

AfkTimeout

Timeout to cause a user to be moved to an AFK voice channel.

Fields

§new: u64

New timeout, in seconds.

§old: u64

Old timeout, in seconds.

§

Allow

Allowed permissions of a permission overwrite target.

Fields

§new: Option<Permissions>

New allowed permissions value.

§old: Option<Permissions>

Old allowed permissions value.

§

ApplicationId

ID of an application.

Fields

§new: Option<Id<ApplicationMarker>>

Application’s ID.

§

Archived

Thread is now archived/unarchived.

Fields

§new: Option<bool>

Whether the thread is archived.

§old: Option<bool>

Previous state, if any.

§

Asset

Asset of a sticker.

Fields

§new: Option<String>

Empty string.

§old: Option<String>

Previous state, if any.

§

AutoArchiveDuration

Auto archive duration of a thread changed.

Fields

§new: Option<AutoArchiveDuration>

New auto archive duration.

§old: Option<AutoArchiveDuration>

Old auto archive duration.

§

Available

Availability of a sticker.

Fields

§new: Option<bool>

New availability.

§old: Option<bool>

Old availability.

§

AvatarHash

Hash of an avatar.

Fields

§new: Option<ImageHash>

New hash of an avatar.

§old: Option<ImageHash>

Old hash of an avatar.

§

BannerHash

Hash of a guild banner.

Fields

§new: Option<ImageHash>

New hash of a guild’s banner.

§old: Option<ImageHash>

Old hash of a guild’s banner.

§

Bitrate

Bitrate of an audio channel.

Fields

§new: Option<u64>

New bitrate.

§old: Option<u64>

Old bitrate.

§

ChannelId

Channel for an invite code.

Fields

§new: Option<Id<ChannelMarker>>

New invite’s channel.

§old: Option<Id<ChannelMarker>>

Old invite’s channel.

§

Code

Code of an invite.

Fields

§new: Option<String>

New invite’s code.

§old: Option<String>

Previous state, if any.

§

Color

Color of a role.

Fields

§new: Option<u64>

New role color.

§old: Option<u64>

Old role color.

§

CommandId

Permissions for a command were updated

Fields

§new: Option<GuildCommandPermissions>

New command permissions.

§old: Option<GuildCommandPermissions>

Old command permissions.

§

CommunicationDisabledUntil

Member timeout state changed.

Fields

§new: Option<Timestamp>

New timeout timestamp.

§old: Option<Timestamp>

Old timeout timestamp.

§

Deaf

Whether a member is guild deafened.

Fields

§new: Option<bool>

Whether a member is now guild deafened.

§old: Option<bool>

Previous state, if any.

§

DefaultAutoArchiveDuration

default auto archive duration for newly created threads changed.

Fields

§new: Option<AutoArchiveDuration>

New auto archive duration.

§old: Option<AutoArchiveDuration>

Old auto archive duration.

§

DefaultMessageNotifications

Default message notification level for a guild.

Fields

§new: Option<DefaultMessageNotificationLevel>

New default message notification level.

§old: Option<DefaultMessageNotificationLevel>

Old default message notification level.

§

Deny

Denied permissions of a permission overwrite target.

Fields

§new: Option<Permissions>

New denied permissions level.

§old: Option<Permissions>

Previous state, if any.

§

Description

Description of a guild or sticker.

Fields

§new: Option<String>

New guild description.

§old: Option<String>

Old guild description.

§

DiscoverySplashHash

Hash of a guild’s discovery splash.

Fields

§new: Option<ImageHash>

New discovery splash hash.

§old: Option<ImageHash>

Old discovery splash hash.

§

EnableEmoticons

Whether emoticons are enabled.

Fields

§new: Option<bool>

Whether emoticons are now enabled.

§old: Option<bool>

Whether emoticons were enabled.

§

EntityType

Entity type of guild scheduled event was changed.

Fields

§new: Option<u64>

New entity type.

§old: Option<u64>

Previous state, if any.

§

ExpireBehavior

Behavior of the expiration of an integration.

Fields

§new: Option<u64>

New expiration behavior.

§old: Option<u64>

Previous state, if any.

§

ExpireGracePeriod

Grace period of the expiration of an integration.

Fields

§new: Option<u64>

New expiration grace period.

§old: Option<u64>

Previous state, if any.

§

ExplicitContentFilter

Explicit content filter level of a guild.

Fields

§new: Option<ExplicitContentFilter>

New explicit content filter level.

§old: Option<ExplicitContentFilter>

Old explicit content filter level.

§

FormatType

Format type of a sticker.

Fields

§new: Option<StickerFormatType>

New format type of a sticker.

§old: Option<StickerFormatType>

Old format type of a sticker.

§

GuildId

Guild that a sticker is in.

Fields

§new: Option<Id<GuildMarker>>

New guild that a sticker is in.

§old: Option<Id<GuildMarker>>

Old guild that a sticker is in.

§

Hoist

Whether a role is hoisted.

Fields

§new: Option<bool>

Whether a role is now hoisted.

§old: Option<bool>

Whether a role was hoisted.

§

IconHash

Hash of a guild icon.

Fields

§new: Option<ImageHash>

New hash of a guild’s icon.

§old: Option<ImageHash>

Old hash of a guild’s icon.

§

Id

ID of an entity.

Fields

§new: Option<Id<GenericMarker>>

New entity’s ID.

§

ImageHash

Hash of a guild scheduled event cover.

Fields

§new: Option<ImageHash>

New hash of a guild’s icon.

§old: Option<ImageHash>

Old hash of a guild’s icon.

§

Invitable

Invitable state of a private thread.

Fields

§new: Option<bool>

New threads invitable state.

§old: Option<bool>

Old threads invitable state.

§

InviterId

ID of the user who created an invite.

Fields

§new: Option<Id<UserMarker>>

User ID.

§

Location

Location for a scheduled event changed.

Can be an Id<ChannelMarker> or a String.

Fields

§

Locked

Thread was locked or unlocked.

Fields

§new: Option<bool>

Whether the thread is now locked.

§old: Option<bool>

Previous state, if any.

§

MaxAge

Maximum age of an invite.

Fields

§new: Option<u64>

New maximum age.

§old: Option<u64>

Previous state, if any.

§

MaxUses

Maximum uses of an invite.

Fields

§new: Option<u64>

New maximum uses.

§old: Option<u64>

Previous state, if any.

§

Mentionable

Whether a role can be mentioned in a message.

Fields

§new: Option<bool>

Whether a role is now mentionable.

§old: Option<bool>

Whether a role was mentionable.

§

MfaLevel

Multi-Factor Authentication level required of a guild’s moderators.

Fields

§new: Option<MfaLevel>

New MFA level of a guild.

§old: Option<MfaLevel>

Old MFA level of a guild.

§

Mute

Whether a user is guild muted.

Fields

§new: Option<bool>

Whether a member is now muted.

§old: Option<bool>

Whether a member was muted.

§

Name

Name of an entity such as a channel or role.

Fields

§new: Option<String>

New entity name.

§old: Option<String>

Old entity name.

§

Nick

Nickname of a member.

Fields

§new: Option<String>

New member nickname.

§old: Option<String>

Old member nickname.

§

Nsfw

Whether a channel is NSFW.

Fields

§new: Option<bool>

New state.

§old: Option<bool>

Previous state, if any.

§

NsfwLevel

NSFW level of a guild.

Fields

§new: Option<NSFWLevel>

New NSFW level.

§old: Option<NSFWLevel>

Old NSFW level.

§

OwnerId

ID of the owner of a guild.

Fields

§new: Option<Id<UserMarker>>

New owner’s ID.

§old: Option<Id<UserMarker>>

Old owner’s ID.

§

PermissionOverwrites

Permission overwrites on a channel changed.

Fields

§new: Option<Vec<PermissionOverwrite>>

New set of overwrites.

§old: Option<Vec<PermissionOverwrite>>

Old set of overwrites.

§

Permissions

Default permissions of a role.

Fields

§new: Option<Permissions>

New set of permissions.

§old: Option<Permissions>

Old set of permissions.

§

Position

Position of an entity such as a channel or role.

Fields

§new: Option<u64>

New position value.

§old: Option<u64>

Old position value.

§

PreferredLocale

Preferred locale of a guild.

Fields

§new: Option<String>

New preferred locale.

§old: Option<String>

Old preferred locale.

§

PrivacyLevel

Privacy level of a stage instance.

Fields

§new: Option<PrivacyLevel>

New privacy level.

§old: Option<PrivacyLevel>

Old privacy level.

§

PruneDeleteDays

Number of days’ worth of inactivity for a guild prune.

Fields

§new: Option<u64>

Number of days.

§

PublicUpdatesChannelId

ID of a guild’s public updates channel.

Fields

§new: Option<Id<ChannelMarker>>

New public updates channel ID.

§old: Option<Id<ChannelMarker>>

Old public updates channel ID.

§

RateLimitPerUser

Ratelimit per user in a textual channel.

Fields

§new: Option<u64>

New ratelimit, in seconds.

§old: Option<u64>

Old ratelimit, in seconds.

§

Region

Region of a guild changed.

Fields

§new: Option<String>

New region.

§old: Option<String>

Previous state, if any.

§

RoleAdded

Role was added to a user.

Fields

§new: Vec<AffectedRole>

Minimal information about a added role.

§old: Vec<AffectedRole>

Previous state, if any.

§

RoleRemoved

Role was removed from a user.

Fields

§new: Vec<AffectedRole>

Minimal information about a removed role.

§old: Vec<AffectedRole>

Previous state, if any.

§

RulesChannelId

Guild’s rules channel.

Fields

§new: Option<Id<ChannelMarker>>

New rules channel.

§old: Option<Id<ChannelMarker>>

Old rules channel.

§

SplashHash

Hash of a guild’s splash.

Fields

§new: Option<ImageHash>

Old hash of a guild’s splash.

§old: Option<ImageHash>

New hash of a guild’s splash.

§

Status

Status of guild scheduled event was changed.

Fields

§new: Option<u64>

New status.

§old: Option<u64>

Previous state, if any.

§

SystemChannelId

ID of guild’s system channel.

Fields

§new: Option<Id<ChannelMarker>>

New system channel ID.

§old: Option<Id<ChannelMarker>>

Old system channel ID.

§

Tags

Related emoji of a sticker.

Fields

§new: Option<String>

New related emoji of a sticker.

§old: Option<String>

Old related emoji of a sticker.

§

Temporary

Whether an invite is temporary.

Fields

§new: Option<bool>

New temporary state.

§old: Option<bool>

Previous state, if any.

§

Topic

Topic of a textual channel.

Fields

§new: Option<String>

New topic.

§old: Option<String>

Old topic.

§

Type

Type of a created entity.

The value of a type is dependent on the entity. For example, a channel’s type may be an integer while an integration’s may be a string.

Fields

§new: Option<AuditLogChangeTypeValue>

New target type.

§old: Option<AuditLogChangeTypeValue>

Old target type.

§

UnicodeEmoji

Unicode emoji of a role icon changed.

Fields

§new: Option<String>

New unicode emoji.

§old: Option<String>

Old target type.

§

UserLimit

Maximum number of users in a voice channel.

Fields

§new: Option<u64>

New limit.

§old: Option<u64>

Old limit.

§

Uses

Number of uses of an invite.

Fields

§new: Option<u64>

Number of uses.

§old: Option<u64>

Previous state, if any.

§

VanityUrlCode

Code of a guild’s vanity invite.

Fields

§new: Option<String>

New vanity URL code.

§old: Option<String>

Old vanity URL code.

§

VerificationLevel

Required verification level of new members in a guild.

Fields

§new: Option<VerificationLevel>

New verification level.

§old: Option<VerificationLevel>

Old verification level.

§

WidgetChannelId

Channel ID of a widget.

Fields

§new: Option<Id<ChannelMarker>>

New channel ID.

§old: Option<Id<ChannelMarker>>

Old channel ID.

§

WidgetEnabled

Whether a widget is enabled.

Fields

§new: Option<bool>

New state of a widget being enabled.

§old: Option<bool>

Old state of a widget being enabled.

§

Other

Other type of change not covered by other variants.

Implementations§

source§

impl AuditLogChange

source

pub const fn key(&self) -> Option<AuditLogChangeKey>

Key of an audit log change.

This may return no key if the variant is Other.

§Examples

Check the key of a Uses change:

use twilight_model::guild::audit_log::{AuditLogChange, AuditLogChangeKey};

let change = AuditLogChange::UserLimit {
    new: Some(6),
    old: Some(3),
};

assert_eq!(Some(AuditLogChangeKey::UserLimit), change.key());

Trait Implementations§

source§

impl Clone for AuditLogChange

source§

fn clone(&self) -> AuditLogChange

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for AuditLogChange

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for AuditLogChange

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Hash for AuditLogChange

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for AuditLogChange

source§

fn eq(&self, other: &AuditLogChange) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for AuditLogChange

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Eq for AuditLogChange

source§

impl StructuralPartialEq for AuditLogChange

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,