Class WebhookImpl

    • Constructor Detail

      • WebhookImpl

        protected WebhookImpl​(DiscordApi api,
                              com.fasterxml.jackson.databind.JsonNode data)
        Creates a new webhook.
        Parameters:
        api - The discord api instance.
        data - The json data of the webhook.
    • Method Detail

      • createWebhook

        public static WebhookImpl createWebhook​(DiscordApi api,
                                                com.fasterxml.jackson.databind.JsonNode data)
        Creates a new webhook.
        Parameters:
        api - The discord api instance.
        data - The json data of the webhook.
        Returns:
        The new webhook.
      • createAllIncomingWebhooksFromJsonArray

        public static java.util.List<Webhook> createAllIncomingWebhooksFromJsonArray​(DiscordApi api,
                                                                                     com.fasterxml.jackson.databind.JsonNode jsonArray)
        Gets all the incoming webhooks that may or may not have a token from a json array.
        Parameters:
        api - The discord api instance.
        jsonArray - The json array of the webhooks.
        Returns:
        All incoming webhooks from the array.
      • getServerId

        public java.util.Optional<java.lang.Long> getServerId()
        Specified by:
        getServerId in interface Webhook
      • getCreator

        public java.util.Optional<User> getCreator()
        Specified by:
        getCreator in interface Webhook
      • getName

        public java.util.Optional<java.lang.String> getName()
        Specified by:
        getName in interface Webhook
      • getAvatar

        public java.util.Optional<Icon> getAvatar()
        Specified by:
        getAvatar in interface Webhook
      • delete

        public java.util.concurrent.CompletableFuture<java.lang.Void> delete​(java.lang.String reason)
        Specified by:
        delete in interface Deletable
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object