Interface IncomingWebhook

    • Method Detail

      • isIncomingWebhook

        default boolean isIncomingWebhook​()
        Description copied from interface: Webhook
        Checks if the webhook is an incoming webhook.
        Specified by:
        isIncomingWebhook in interface Webhook
        Returns:
        Whether the webhook an incoming webhook.
      • isChannelFollowerWebhook

        default boolean isChannelFollowerWebhook​()
        Description copied from interface: Webhook
        Checks if the webhook is an channel follower webhook.
        Specified by:
        isChannelFollowerWebhook in interface Webhook
        Returns:
        Whether the webhook an channel following webhook.
      • getToken

        String getToken​()
        Gets the secure token of the webhook.
        Returns:
        The secure token of the webhook.
      • getUrl

        default URL getUrl​()
        Gets the secure url of the webhook.
        Returns:
        The secure url of the webhook.
      • getLatestInstance

        default CompletableFuture<Webhook> getLatestInstance​()
        Description copied from interface: Updatable
        Gets an updated instance of this entity from the cache or from Discord directly. This is for example necessary if an instance got invalid by a reconnect to Discord which invalidates all existing instances which means they do not get any further updates from Discord applied. Due to that, references to instances should usually not be held for an extended period of time. If they are, this method can be used to retrieve the current instance from the cache if present or from Discord directly.

        This method returns the currently cached entity if present, or request the entity from Discord if it is not cached or not permanently cached. If the entity is a fully cached entity and is not in the cache any longer, for example because it was deleted or the message was thrown out of the cache, the CompletableFuture completes exceptionally with a NoSuchElementException. If a request to Discord is made, the according remote call exception will be used to complete the CompletableFuture exceptionally.

        Specified by:
        getLatestInstance in interface Updatable<Webhook>
        Specified by:
        getLatestInstance in interface Webhook
        Returns:
        The current cached instance.
      • sendMessage

        default CompletableFuture<Message> sendMessage​(EmbedBuilder... embeds)
        Sends a message.
        Parameters:
        embeds - The embeds which should be displayed.
        Returns:
        The sent message.
      • sendMessage

        default CompletableFuture<Message> sendMessage​(String content,
                                                       EmbedBuilder... embeds)
        Sends a message.
        Parameters:
        content - The content of the message.
        embeds - The embeds which should be displayed.
        Returns:
        The sent message.
      • sendMessage

        default CompletableFuture<Message> sendMessage​(String content,
                                                       EmbedBuilder embed,
                                                       String displayName,
                                                       URL avatarUrl)
        Sends a message.
        Parameters:
        content - The content of the message.
        displayName - The name which should be used by the webhook.
        avatarUrl - The avatar which should be used by the webhook.
        embed - The embed which should be displayed.
        Returns:
        The sent message.
      • sendMessage

        default CompletableFuture<Message> sendMessage​(String content,
                                                       EmbedBuilder embed,
                                                       String displayName,
                                                       Icon avatar)
        Sends a message.
        Parameters:
        content - The content of the message.
        displayName - The name which should be used by the webhook.
        avatar - The avatar which should be used by the webhook.
        embed - The embed which should be displayed.
        Returns:
        The sent message.
      • sendMessage

        default CompletableFuture<Message> sendMessage​(String content,
                                                       String displayName,
                                                       URL avatarUrl)
        Sends a message.
        Parameters:
        content - The content of the message.
        displayName - The name which should be used by the webhook.
        avatarUrl - The avatar which should be used by the webhook.
        Returns:
        The sent message.
      • sendMessage

        default CompletableFuture<Message> sendMessage​(String content,
                                                       String displayName,
                                                       Icon avatar)
        Sends a message.
        Parameters:
        content - The content of the message.
        displayName - The name which should be used by the webhook.
        avatar - The avatar which should be used by the webhook.
        Returns:
        The sent message.
      • sendMessage

        default CompletableFuture<Message> sendMessage​(EmbedBuilder embed,
                                                       String displayName,
                                                       URL avatarUrl)
        Sends a message.
        Parameters:
        embed - The embed which should be displayed.
        displayName - The name which should be used by the webhook.
        avatarUrl - The avatar which should be used by the webhook.
        Returns:
        The sent message.
      • sendMessage

        default CompletableFuture<Message> sendMessage​(EmbedBuilder embed,
                                                       String displayName,
                                                       Icon avatar)
        Sends a message.
        Parameters:
        embed - The embed which should be displayed.
        displayName - The name which should be used by the webhook.
        avatar - The avatar which should be used by the webhook.
        Returns:
        The sent message.