Table of Contents

Class AuditLogEntry

Namespace
NetCord.Gateway
Assembly
NetCord.dll
public class AuditLogEntry : Entity, IEntity, ISpanFormattable, IFormattable, IEquatable<Entity>, IJsonModel<JsonAuditLogEntry>
Inheritance
AuditLogEntry
Implements
Derived
Inherited Members

Constructors

AuditLogEntry(JsonAuditLogEntry, ulong)

public AuditLogEntry(JsonAuditLogEntry jsonModel, ulong guildId)

Parameters

jsonModel JsonAuditLogEntry
guildId ulong

Properties

ActionType

Type of action that occurred.

public AuditLogEvent ActionType { get; }

Property Value

AuditLogEvent

Changes

Changes made to the TargetId.

public IReadOnlyDictionary<string, AuditLogChange> Changes { get; }

Property Value

IReadOnlyDictionary<string, AuditLogChange>

GuildId

The ID of the guild this audit log entry belongs to.

public ulong GuildId { get; }

Property Value

ulong

Id

The unique identifier for this object.

public override ulong Id { get; }

Property Value

ulong

Options

Additional info for certain event types.

public AuditLogEntryInfo? Options { get; }

Property Value

AuditLogEntryInfo

Reason

Reason for the change (1-512 characters).

public string? Reason { get; }

Property Value

string

TargetId

ID of the affected entity.

public ulong? TargetId { get; }

Property Value

ulong?

UserId

ID of user that made the changes.

public ulong? UserId { get; }

Property Value

ulong?

Methods

GetChange<TObject, TValue>(Expression<Func<TObject, TValue?>>)

Finds specified change based on expression.

public AuditLogChange<TValue> GetChange<TObject, TValue>(Expression<Func<TObject, TValue?>> expression) where TObject : JsonEntity

Parameters

expression Expression<Func<TObject, TValue>>

Expression finding the change, for example: channel => channel.Name.

Returns

AuditLogChange<TValue>

Type Parameters

TObject
TValue

Exceptions

EntityNotFoundException

GetChange<TObject, TValue>(Expression<Func<TObject, TValue?>>, JsonTypeInfo<TValue>)

Finds specified change based on expression.

public AuditLogChange<TValue> GetChange<TObject, TValue>(Expression<Func<TObject, TValue?>> expression, JsonTypeInfo<TValue> jsonTypeInfo) where TObject : JsonEntity

Parameters

expression Expression<Func<TObject, TValue>>

Expression finding the change, for example: channel => channel.Name.

jsonTypeInfo JsonTypeInfo<TValue>

JsonTypeInfo<T> of the object returned by expression.

Returns

AuditLogChange<TValue>

Type Parameters

TObject
TValue

Exceptions

EntityNotFoundException

TryGetChange<TObject, TValue>(Expression<Func<TObject, TValue?>>, out AuditLogChange<TValue>)

Tries to find specified change based on expression.

public bool TryGetChange<TObject, TValue>(Expression<Func<TObject, TValue?>> expression, out AuditLogChange<TValue> change) where TObject : JsonEntity

Parameters

expression Expression<Func<TObject, TValue>>

Expression finding the change, for example: channel => channel.Name.

change AuditLogChange<TValue>

The result.

Returns

bool

Type Parameters

TObject
TValue

TryGetChange<TObject, TValue>(Expression<Func<TObject, TValue?>>, JsonTypeInfo<TValue>, out AuditLogChange<TValue>)

Tries to find specified change based on expression.

public bool TryGetChange<TObject, TValue>(Expression<Func<TObject, TValue?>> expression, JsonTypeInfo<TValue> jsonTypeInfo, out AuditLogChange<TValue> change) where TObject : JsonEntity

Parameters

expression Expression<Func<TObject, TValue>>

Expression finding the change, for example: channel => channel.Name.

jsonTypeInfo JsonTypeInfo<TValue>

JsonTypeInfo<T> of the object returned by expression.

change AuditLogChange<TValue>

The result.

Returns

bool

Type Parameters

TObject
TValue