Package discord4j.core.object.audit
Class AuditLogEntry
- java.lang.Object
-
- discord4j.core.object.audit.AuditLogEntry
-
- All Implemented Interfaces:
DiscordObject
,Entity
public class AuditLogEntry extends Object implements Entity
-
-
Field Summary
Fields Modifier and Type Field Description static int
MAX_REASON_LENGTH
The maximum amount of characters that can be in an audit log reason.
-
Constructor Summary
Constructors Constructor Description AuditLogEntry(GatewayDiscordClient gateway, discord4j.discordjson.json.AuditLogEntryData data)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method 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 theGatewayDiscordClient
that created this object.discord4j.discordjson.json.AuditLogEntryData
getData()
Gets the data of the audit log entry.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()
Deprecated.UsegetUserId()
Optional<Snowflake>
getTargetId()
Gets the id of the affected entity (webhook, user, role, etc.), if present.Optional<Snowflake>
getUserId()
Gets the user who made the changes, if present.String
toString()
-
-
-
Field Detail
-
MAX_REASON_LENGTH
public static final int MAX_REASON_LENGTH
The maximum amount of characters that can be in an audit log reason.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AuditLogEntry
public AuditLogEntry(GatewayDiscordClient gateway, discord4j.discordjson.json.AuditLogEntryData data)
-
-
Method Detail
-
getData
public discord4j.discordjson.json.AuditLogEntryData getData()
Gets the data of the audit log entry.- Returns:
- The data of the audit log entry.
-
getTargetId
public Optional<Snowflake> getTargetId()
Gets the id of the affected entity (webhook, user, role, etc.), if present.- Returns:
- The id of the affected entity (webhook, user, role, etc.), if present.
-
getResponsibleUserId
public Snowflake getResponsibleUserId()
Deprecated.UsegetUserId()
Gets the user who made the changes.- Returns:
- The user who made the changes.
-
getUserId
public Optional<Snowflake> getUserId()
Gets the user who made the changes, if present.- Returns:
- The user who made the changes, if present.
-
getReason
public Optional<String> getReason()
Gets the reason for the change, if present.- Returns:
- The reason for the change, if present.
-
getActionType
public ActionType getActionType()
Gets type of action that occurred.- Returns:
- The type of action that occurred.
-
getChange
public <T> Optional<AuditLogChange<T>> getChange(ChangeKey<T> changeKey)
Gets the changes made to the target id, if present.- Type Parameters:
T
- The type of the audit log change key.- Parameters:
changeKey
- The audit log change key.- Returns:
- The changes made to the target id, if present.
-
getId
public Snowflake getId()
Description copied from interface:Entity
Gets the Snowflake that uniquely identifies this entity.
-
getClient
public GatewayDiscordClient getClient()
Description copied from interface:DiscordObject
Returns theGatewayDiscordClient
that created this object. Methods in it are exclusively based on the entity cache orStore
in use. Refer to callinggetClient().rest()
to access aDiscordClient
that is capable of requesting entities directly from the REST API.- Specified by:
getClient
in interfaceDiscordObject
- Returns:
- The
GatewayDiscordClient
associated to this object.
-
-