Package com.mewna.catnip.entity.channel
Interface Webhook
- All Superinterfaces:
Entity
,GuildEntity
,HasChannel
,HasGuild
,HasNullableName
,Snowflake
,Timestamped
- All Known Implementing Classes:
WebhookImpl
A webhook on a channel. Allows sending messages to a text channel in a guild
without having to have a bot application.
- Since:
- 9/15/18
- Author:
- natanbc
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.mewna.catnip.entity.partials.Timestamped
Timestamped.TimestampStyle
-
Method Summary
Modifier and TypeMethodDescriptionavatar()
default io.reactivex.rxjava3.core.Completable
delete()
Deletes the webhook.default Webhook.WebhookEditFields
edit()
Edit this webhook.default io.reactivex.rxjava3.core.Single<Message>
executeWebhook
(Embed embed) Send a message to this channel with the specified embed.default io.reactivex.rxjava3.core.Single<Message>
executeWebhook
(Embed embed, String username, String avatarUrl) Send a message to this channel with the specified embed.default io.reactivex.rxjava3.core.Single<Message>
executeWebhook
(MessageOptions options) Send a message to this channel with the specified options.default io.reactivex.rxjava3.core.Single<Message>
executeWebhook
(MessageOptions options, String username, String avatarUrl) Send a message to this channel with the specified options.default io.reactivex.rxjava3.core.Single<Message>
executeWebhook
(String content) Send a message to this channel with the specified content.default io.reactivex.rxjava3.core.Single<Message>
executeWebhook
(String content, String username, String avatarUrl) Send a message to this channel with the specified content.token()
default String
url()
user()
Methods inherited from interface com.mewna.catnip.entity.partials.GuildEntity
guild
Methods inherited from interface com.mewna.catnip.entity.partials.HasChannel
channelId, channelIdAsLong
Methods inherited from interface com.mewna.catnip.entity.partials.HasGuild
guildId, guildIdAsLong
Methods inherited from interface com.mewna.catnip.entity.partials.HasNullableName
name
Methods inherited from interface com.mewna.catnip.entity.partials.Snowflake
creationTime, creationTimestamp, id, idAsLong
Methods inherited from interface com.mewna.catnip.entity.partials.Timestamped
asDiscordTimestamp, parseTimestamp
-
Method Details
-
executeWebhook
Send a message to this channel with the specified content.- Parameters:
content
- The text content to send.- Returns:
- A Single that completes when the message is sent.
-
executeWebhook
Send a message to this channel with the specified embed.- Parameters:
embed
- The embed to send.- Returns:
- A Single that completes when the message is sent.
-
executeWebhook
@Nonnull default io.reactivex.rxjava3.core.Single<Message> executeWebhook(@Nonnull MessageOptions options) Send a message to this channel with the specified options.- Parameters:
options
- The options for the message being sent.- Returns:
- A Single that completes when the message is sent.
-
executeWebhook
@Nonnull default io.reactivex.rxjava3.core.Single<Message> executeWebhook(@Nonnull String content, @Nullable String username, @Nullable String avatarUrl) Send a message to this channel with the specified content.- Parameters:
content
- The text content to send.username
- The username to override the webhook, if set.avatarUrl
- The avatar to override the webhook, if set.- Returns:
- A Single that completes when the message is sent.
-
executeWebhook
@Nonnull default io.reactivex.rxjava3.core.Single<Message> executeWebhook(@Nonnull Embed embed, @Nullable String username, @Nullable String avatarUrl) Send a message to this channel with the specified embed.- Parameters:
embed
- The embed to send.username
- The username to override the webhook, if set.avatarUrl
- The avatar to override the webhook, if set.- Returns:
- A Single that completes when the message is sent.
-
executeWebhook
@Nonnull default io.reactivex.rxjava3.core.Single<Message> executeWebhook(@Nonnull MessageOptions options, @Nullable String username, @Nullable String avatarUrl) Send a message to this channel with the specified options.- Parameters:
options
- The options for the message being sent.username
- The username to override the webhook, if set.avatarUrl
- The avatar to override the webhook, if set.- Returns:
- A Single that completes when the message is sent.
-
user
- Returns:
- The user that created this webhook.
-
avatar
- Returns:
- The default avatar of the webhook.
-
token
- Returns:
- The secure token of the webhook.
-
url
- Returns:
- The full URL of the webhook that can be used for requests.
-
delete
@Nonnull @CheckReturnValue default io.reactivex.rxjava3.core.Completable delete()Deletes the webhook.- Returns:
- A Single that completes when the webhook is deleted.
-
edit
Edit this webhook.- Returns:
- A webhook editor that can complete the editing.
-