public final class Webhook extends Object implements Entity
Constructor and Description |
---|
Webhook(ServiceMediator serviceMediator,
WebhookBean data)
Constructs a
Webhook with an associated ServiceMediator and Discord data. |
Modifier and Type | Method and Description |
---|---|
Mono<Void> |
delete()
Requests to delete this webhook.
|
Mono<Void> |
delete(String reason)
Requests to delete this webhook while optionally specifying a reason.
|
Mono<Webhook> |
edit(Consumer<? super WebhookEditSpec> spec)
Requests to edit this webhook.
|
boolean |
equals(Object obj) |
Optional<String> |
getAvatar()
Gets the avatar of this webhook, if present.
|
Mono<TextChannel> |
getChannel()
Requests to retrieve the channel this webhook is associated to.
|
Snowflake |
getChannelId()
Gets the ID of the channel this webhook is associated to.
|
DiscordClient |
getClient()
Gets the DiscordClient associated to this object.
|
Mono<User> |
getCreator()
Requests to retrieve the user this webhook was created by, if present.
|
Snowflake |
getCreatorId()
Gets the ID of the user this webhook was created by.
|
Mono<Guild> |
getGuild()
Requests to retrieve the guild this webhook is associated to.
|
Snowflake |
getGuildId()
Gets the ID of the guild this webhook is associated to.
|
Snowflake |
getId()
Gets the Snowflake that uniquely identifies this entity.
|
Optional<String> |
getName()
Gets the default name of the webhook.
|
String |
getToken()
Gets the secure token of this webhook.
|
int |
hashCode() |
String |
toString() |
public Webhook(ServiceMediator serviceMediator, WebhookBean data)
Webhook
with an associated ServiceMediator and Discord data.serviceMediator
- The ServiceMediator associated to this object, must be non-null.data
- The raw data as represented by Discord, must be non-null.public DiscordClient getClient()
DiscordObject
getClient
in interface DiscordObject
public Snowflake getId()
Entity
public Snowflake getGuildId()
public Mono<Guild> getGuild()
public Snowflake getChannelId()
public Mono<TextChannel> getChannel()
public Snowflake getCreatorId()
public Mono<User> getCreator()
public Optional<String> getName()
public Optional<String> getAvatar()
public String getToken()
public Mono<Void> delete()
Mono
where, upon successful completion, emits nothing; indicating the webhook has been deleted.
If an error is received, it is emitted through the Mono
.public Mono<Void> delete(@Nullable String reason)
reason
- The reason, if present.Mono
where, upon successful completion, emits nothing; indicating the webhook has been deleted.
If an error is received, it is emitted through the Mono
.public Mono<Webhook> edit(Consumer<? super WebhookEditSpec> spec)
spec
- A Consumer
that provides a "blank" WebhookEditSpec
to be operated on.Mono
where, upon successful completion, emits the edited Guild
. If an error is
received, it is emitted through the Mono
.