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 RestWebhookcreate(RestClient restClient, Snowflake id) Create aRestWebhookfor a given ID.Delete a webhook permanently.booleanMono<discord4j.discordjson.json.WebhookData>getData()Retrieve this webhook's data upon subscription.getId()Returns the ID of this webhook.inthashCode()Mono<discord4j.discordjson.json.WebhookData>Modify a webhook.
-
Method Details
-
create
Create aRestWebhookfor 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
RestWebhookrepresented 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
Monowhere, upon successful completion, emits theWebhookDatabelonging 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_WEBHOOKSpermission. Returns the updated webhook object on success.- Parameters:
request- a request to modify the webhookreason- an optional reason for the audit log- Returns:
- a
Monowhere, upon subscription, emits the updatedWebhookDataon success. If an error is received, it is emitted through theMono.
-
delete
Delete a webhook permanently. Requires thePermission.MANAGE_WEBHOOKSpermission. Returns empty on success.- Parameters:
reason- an optional reason for the audit log- Returns:
- a
Monowhere, upon subscription, emits a complete signal on success. If an error is received, it is emitted through theMono.
-
equals
-
hashCode
public int hashCode()
-