public class AuditLogEntry extends Object implements Entity
Modifier and Type | Field and Description |
---|---|
static int |
MAX_REASON_LENGTH
The maximum amount of characters that can be in an audit log reason.
|
Constructor and Description |
---|
AuditLogEntry(GatewayDiscordClient gateway,
discord4j.discordjson.json.AuditLogEntryData data) |
Modifier and Type | Method and Description |
---|---|
ActionType |
getActionType()
Gets type of action that occurred.
|
<T> Optional<AuditLogChange<T>> |
getChange(ChangeKey<T> changeKey)
Gets the changes made to the target id, if present.
|
GatewayDiscordClient |
getClient()
Returns the
GatewayDiscordClient that created this object. |
Snowflake |
getId()
Gets the Snowflake that uniquely identifies this entity.
|
<T> Optional<T> |
getOption(OptionKey<T> optionKey) |
Optional<String> |
getReason()
Gets the reason for the change, if present.
|
Snowflake |
getResponsibleUserId()
Gets the user who made the changes.
|
Optional<Snowflake> |
getTargetId()
Gets the id of the affected entity (webhook, user, role, etc.), if present.
|
String |
toString() |
public static final int MAX_REASON_LENGTH
public AuditLogEntry(GatewayDiscordClient gateway, discord4j.discordjson.json.AuditLogEntryData data)
public Optional<Snowflake> getTargetId()
public Snowflake getResponsibleUserId()
public Optional<String> getReason()
public ActionType getActionType()
public <T> Optional<AuditLogChange<T>> getChange(ChangeKey<T> changeKey)
T
- The type of the audit log change key.changeKey
- The audit log change key.public Snowflake getId()
Entity
public GatewayDiscordClient getClient()
DiscordObject
GatewayDiscordClient
that created this object. Methods in it are exclusively based on the
entity cache or Store
in use. Refer to calling getClient().rest()
to access a
DiscordClient
that is capable of requesting entities directly from the REST API.getClient
in interface DiscordObject
GatewayDiscordClient
associated to this object.