Interface Webhook

All Superinterfaces:
Entity, GuildEntity, HasChannel, HasGuild, HasNullableName, Snowflake, Timestamped
All Known Implementing Classes:
WebhookImpl

public interface Webhook extends GuildEntity, Snowflake, HasNullableName, HasChannel
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
  • Method Details

    • executeWebhook

      @Nonnull default io.reactivex.rxjava3.core.Single<Message> executeWebhook(@Nonnull String content)
      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

      @Nonnull default io.reactivex.rxjava3.core.Single<Message> executeWebhook(@Nonnull Embed embed)
      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

      @Nullable @CheckReturnValue User user()
      Returns:
      The user that created this webhook.
    • avatar

      @Nullable @CheckReturnValue String avatar()
      Returns:
      The default avatar of the webhook.
    • token

      @Nonnull @CheckReturnValue String token()
      Returns:
      The secure token of the webhook.
    • url

      @Nonnull @CheckReturnValue default String 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

      @Nonnull @CheckReturnValue default Webhook.WebhookEditFields edit()
      Edit this webhook.
      Returns:
      A webhook editor that can complete the editing.