T - The return typeAuditableRestAction.EmptyRestAction, ChannelAction, InviteAction, net.dv8tion.jda.core.managers.impl.ManagerBase, PermissionOverrideAction, RoleAction, WebhookActionpublic abstract class AuditableRestAction<T> extends RestAction<T>
AccountType.BOT
This will automatically use the ThreadLocalReason if no
reason was specified via reason(String).
| Modifier and Type | Class | 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. |
DEFAULT_FAILURE, DEFAULT_SUCCESS, LOG| Constructor | Description |
|---|---|
AuditableRestAction(JDA api,
net.dv8tion.jda.core.requests.Route.CompiledRoute route) |
|
AuditableRestAction(JDA api,
net.dv8tion.jda.core.requests.Route.CompiledRoute route,
okhttp3.RequestBody data) |
|
AuditableRestAction(JDA api,
net.dv8tion.jda.core.requests.Route.CompiledRoute route,
org.json.JSONObject data) |
| Modifier and Type | Method | Description |
|---|---|---|
AuditableRestAction<T> |
reason(java.lang.String reason) |
Applies the specified reason as audit-log reason field.
|
AuditableRestAction<T> |
setCheck(java.util.function.BooleanSupplier checks) |
Sets the last-second checks before finally executing the http request in the queue.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcomplete, complete, completeAfter, getJDA, isPassContext, queue, queue, queue, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, setPassContext, submit, submit, submitAfter, submitAfterpublic 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)
public AuditableRestAction<T> setCheck(java.util.function.BooleanSupplier checks)
RestActionfalse or throws an exception this will not be finished.
When an exception is thrown from the supplier it will be provided to the failure callback.setCheck in class RestAction<T>checks - The checks to run before executing the request, or null to run no checks@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 AuditLogsThreadLocalReason