Package discord4j.rest.entity
Class RestWebhook
java.lang.Object
discord4j.rest.entity.RestWebhook
Represents a webhook entity in Discord. Webhooks are a low-effort way to post messages to channels in Discord.
-
Method Summary
Modifier and TypeMethodDescriptionstatic RestWebhook
create
(RestClient restClient, Snowflake id) Create aRestWebhook
for a given ID.Delete a webhook permanently.boolean
Mono<discord4j.discordjson.json.WebhookData>
getData()
Retrieve this webhook's data upon subscription.getId()
Returns the ID of this webhook.int
hashCode()
Mono<discord4j.discordjson.json.WebhookData>
Modify a webhook.
-
Method Details
-
create
Create aRestWebhook
for a given ID. This method does not perform any API request.- Parameters:
restClient
- the client to make API requestsid
- the ID of this entity- Returns:
- a
RestWebhook
represented by thisid
.
-
getId
Returns the ID of this webhook.- Returns:
- The ID of this webhook
-
getData
Retrieve this webhook's data upon subscription.- Returns:
- a
Mono
where, upon successful completion, emits theWebhookData
belonging to this entity. If an error is received, it is emitted through theMono
.
-
modify
public Mono<discord4j.discordjson.json.WebhookData> modify(discord4j.discordjson.json.WebhookModifyRequest request, @Nullable String reason) Modify a webhook. Requires thePermission.MANAGE_WEBHOOKS
permission. Returns the updated webhook object on success.- Parameters:
request
- a request to modify the webhookreason
- an optional reason for the audit log- Returns:
- a
Mono
where, upon subscription, emits the updatedWebhookData
on success. If an error is received, it is emitted through theMono
.
-
delete
Delete a webhook permanently. Requires thePermission.MANAGE_WEBHOOKS
permission. Returns empty on success.- Parameters:
reason
- an optional reason for the audit log- Returns:
- a
Mono
where, upon subscription, emits a complete signal on success. If an error is received, it is emitted through theMono
.
-
equals
-
hashCode
public int hashCode()
-