public abstract class AuditableRestAction<T> extends RestAction<T>
Modifier and Type | Class and Description |
---|---|
static class |
AuditableRestAction.EmptyRestAction<T>
Specialized form of
AuditableRestAction that is used to provide information that
has already been retrieved or generated so that another request does not need to be made to Discord. |
static class |
AuditableRestAction.FailedRestAction<T>
Specialized form of
AuditableRestAction that is used to provide information that
an error has occurred while attempting to execute a request. |
DEFAULT_FAILURE, DEFAULT_SUCCESS, LOG
Constructor and Description |
---|
AuditableRestAction(JDA api,
net.dv8tion.jda.core.requests.Route.CompiledRoute route) |
AuditableRestAction(JDA api,
net.dv8tion.jda.core.requests.Route.CompiledRoute route,
org.json.JSONObject data) |
AuditableRestAction(JDA api,
net.dv8tion.jda.core.requests.Route.CompiledRoute route,
okhttp3.RequestBody data) |
Modifier and Type | Method and Description |
---|---|
AuditableRestAction<T> |
reason(java.lang.String reason)
Applies the specified reason as audit-log reason field.
|
complete, complete, completeAfter, getJDA, queue, queue, queue, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, submit, submit, submitAfter, submitAfter
public AuditableRestAction(JDA api, net.dv8tion.jda.core.requests.Route.CompiledRoute route)
public AuditableRestAction(JDA api, net.dv8tion.jda.core.requests.Route.CompiledRoute route, okhttp3.RequestBody data)
public AuditableRestAction(JDA api, net.dv8tion.jda.core.requests.Route.CompiledRoute route, org.json.JSONObject data)
@CheckReturnValue public AuditableRestAction<T> reason(java.lang.String reason)
null
it will be treated as not set.
Reasons for any AuditableRestAction may be retrieved
via AuditLogEntry.getReason()
in iterable AuditLogPaginationActions
from Guild.getAuditLogs()
!
This will specify the reason via the X-Audit-Log-Reason
Request Header.
Note: This may not be available to accounts for AccountType.CLIENT
.
Using methods with a reason parameter will always work and override this header.
(ct. GuildController.ban(User, int, String)
)
reason
- The reason for this action which should be logged in the Guild's AuditLogs