Class Webhook

    • Constructor Detail

      • Webhook

        public Webhook​(ServiceMediator serviceMediator,
                       WebhookBean data)
        Constructs a Webhook with an associated ServiceMediator and Discord data.
        Parameters:
        serviceMediator - The ServiceMediator associated to this object, must be non-null.
        data - The raw data as represented by Discord, must be non-null.
    • Method Detail

      • getClient

        public DiscordClient getClient()
        Description copied from interface: DiscordObject
        Gets the DiscordClient associated to this object.
        Specified by:
        getClient in interface DiscordObject
        Returns:
        The DiscordClient associated to this object.
      • getId

        public Snowflake getId()
        Description copied from interface: Entity
        Gets the Snowflake that uniquely identifies this entity.
        Specified by:
        getId in interface Entity
        Returns:
        The Snowflake that uniquely identifies this entity.
      • getGuildId

        public Snowflake getGuildId()
        Gets the ID of the guild this webhook is associated to.
        Returns:
        The ID of the guild this webhook is associated to.
      • getGuild

        public reactor.core.publisher.Mono<Guild> getGuild()
        Requests to retrieve the guild this webhook is associated to.
        Returns:
        A Mono where, upon successful completion, emits the guild this webhook is associated to. If an error is received, it is emitted through the Mono.
      • getChannelId

        public Snowflake getChannelId()
        Gets the ID of the channel this webhook is associated to.
        Returns:
        The ID of the channel this webhook is associated to.
      • getChannel

        public reactor.core.publisher.Mono<TextChannel> getChannel()
        Requests to retrieve the channel this webhook is associated to.
        Returns:
        A Mono where, upon successful completion, emits the channel this webhook is associated to. If an error is received, it is emitted through the Mono.
      • getCreatorId

        public Snowflake getCreatorId()
        Gets the ID of the user this webhook was created by.
        Returns:
        The ID of the user this webhook was created by.
      • getCreator

        public reactor.core.publisher.Mono<User> getCreator()
        Requests to retrieve the user this webhook was created by, if present.
        Returns:
        A Mono where, upon successful completion, emits the user this webhook was created by, if present. If an error is received, it is emitted through the Mono.
      • getName

        public Optional<String> getName()
        Gets the default name of the webhook.
        Returns:
        The default name of the webhook.
      • getAvatar

        public Optional<String> getAvatar()
        Gets the avatar of this webhook, if present.
        Returns:
        The avatar of this webhook, if present.
      • getToken

        public String getToken()
        Gets the secure token of this webhook.
        Returns:
        The secure token of this webhook.
      • delete

        public reactor.core.publisher.Mono<Void> delete()
        Requests to delete this webhook.
        Returns:
        A Mono where, upon successful completion, emits nothing; indicating the webhook has been deleted. If an error is received, it is emitted through the Mono.
      • delete

        public reactor.core.publisher.Mono<Void> delete​(@Nullable
                                                        String reason)
        Requests to delete this webhook while optionally specifying a reason.
        Parameters:
        reason - The reason, if present.
        Returns:
        A Mono where, upon successful completion, emits nothing; indicating the webhook has been deleted. If an error is received, it is emitted through the Mono.
      • edit

        public reactor.core.publisher.Mono<Webhook> edit​(Consumer<? super WebhookEditSpec> spec)
        Requests to edit this webhook.
        Parameters:
        spec - A Consumer that provides a "blank" WebhookEditSpec to be operated on.
        Returns:
        A Mono where, upon successful completion, emits the edited Guild. If an error is received, it is emitted through the Mono.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object