Class StoreChannel

    • Constructor Detail

      • StoreChannel

        public StoreChannel​(GatewayDiscordClient gateway,
                            discord4j.discordjson.json.ChannelData data)
        Constructs an StoreChannel with an associated GatewayDiscordClient and Discord data.
        Parameters:
        gateway - The GatewayDiscordClient associated to this object, must be non-null.
        data - The raw data as represented by Discord, must be non-null.
    • Method Detail

      • edit

        public discord4j.core.spec.StoreChannelEditMono edit()
        Requests to edit this store channel. Properties specifying how to edit this store channel can be set via the withXxx methods of the returned StoreChannelEditMono.
        Returns:
        A StoreChannelEditMono where, upon successful completion, emits the edited StoreChannel. If an error is received, it is emitted through the StoreChannelEditMono.
      • edit

        public Mono<StoreChannel> edit​(discord4j.core.spec.StoreChannelEditSpec spec)
        Requests to edit this store channel.
        Parameters:
        spec - an immutable object that specifies how to edit this store channel
        Returns:
        A Mono where, upon successful completion, emits the edited StoreChannel. If an error is received, it is emitted through the Mono.
      • toString

        public String toString()
      • getCategory

        public Mono<Category> getCategory()
        Description copied from interface: CategorizableChannel
        Requests to retrieve the category for this channel, if present.
        Specified by:
        getCategory in interface CategorizableChannel
        Returns:
        A Mono where, upon successful completion, emits the category this channel, if present. If an error is received, it is emitted through the Mono.
      • getCategory

        public Mono<Category> getCategory​(EntityRetrievalStrategy retrievalStrategy)
        Description copied from interface: CategorizableChannel
        Requests to retrieve the category for this channel, if present, using the given retrieval strategy.
        Specified by:
        getCategory in interface CategorizableChannel
        Parameters:
        retrievalStrategy - the strategy to use to get the category
        Returns:
        A Mono where, upon successful completion, emits the category this channel, if present. If an error is received, it is emitted through the Mono.
      • createInvite

        public Mono<ExtendedInvite> createInvite​(discord4j.core.spec.InviteCreateSpec spec)
        Description copied from interface: CategorizableChannel
        Requests to create an invite.
        Specified by:
        createInvite in interface CategorizableChannel
        Parameters:
        spec - an immutable object that specifies how to create the invite
        Returns:
        A Mono where, upon successful completion, emits the created ExtendedInvite. If an error is received, it is emitted through the Mono.
      • getGuildId

        public final Snowflake getGuildId()
        Description copied from interface: GuildChannel
        Gets the ID of the guild this channel is associated to.
        Specified by:
        getGuildId in interface GuildChannel
        Returns:
        The ID of the guild this channel is associated to.
      • getGuild

        public final Mono<Guild> getGuild()
        Description copied from interface: GuildChannel
        Requests to retrieve the guild this channel is associated to.
        Specified by:
        getGuild in interface GuildChannel
        Returns:
        A Mono where, upon successful completion, emits the guild this channel is associated to. If an error is received, it is emitted through the Mono.
      • getGuild

        public Mono<Guild> getGuild​(EntityRetrievalStrategy retrievalStrategy)
        Description copied from interface: GuildChannel
        Requests to retrieve the guild this channel is associated to, using the given retrieval strategy.
        Specified by:
        getGuild in interface GuildChannel
        Parameters:
        retrievalStrategy - the strategy to use to get the guild
        Returns:
        A Mono where, upon successful completion, emits the guild this channel is associated to. If an error is received, it is emitted through the Mono.
      • getEffectivePermissions

        public Mono<PermissionSet> getEffectivePermissions​(Snowflake memberId)
        Description copied from interface: GuildChannel
        Gets the permissions for the given member, taking into account permission overwrites in this channel.
        Specified by:
        getEffectivePermissions in interface GuildChannel
        Parameters:
        memberId - The ID of the member to get permissions for.
        Returns:
        The permissions for the given member.
      • getEffectivePermissions

        public Mono<PermissionSet> getEffectivePermissions​(Member member)
        Description copied from interface: GuildChannel
        Gets the permissions for the given member, taking into account permission overwrites in this channel.
        Specified by:
        getEffectivePermissions in interface GuildChannel
        Parameters:
        member - The member to get permissions for.
        Returns:
        The permissions for the given member.
      • getName

        public final String getName()
        Description copied from interface: GuildChannel
        Gets the name of the channel.
        Specified by:
        getName in interface GuildChannel
        Returns:
        The name of the channel.
      • getRawPosition

        public int getRawPosition()
        Description copied from interface: GuildChannel
        Gets the raw position of the channel as exposed by Discord. This may or may not be accurate with relativity to other channels in the guild.
        Specified by:
        getRawPosition in interface GuildChannel
        Returns:
        The raw position of the channel.
      • getPosition

        public final Mono<Integer> getPosition()
        Description copied from interface: GuildChannel
        Requests to retrieve the position of the channel relative to other channels in the guild.

        This is determined by the index of this channel in the sorted list of channels of the guild.

        Warning: Because this method must sort the guild channels, it is inefficient to make repeated invocations for the same set of channels (meaning that channels haven't been added or removed). For example, instead of writing:

         
         guild.getChannels()
           .flatMap(c -> c.getPosition().map(pos -> c.getName() + " : " + pos))
         
         
        It would be much more efficient to write:
         
         guild.getChannels()
           .transform(OrderUtil::orderGuildChannels)
           .index((pos, c) -> c.getName() + " : " + pos)
         
         
        Specified by:
        getPosition in interface GuildChannel
        Returns:
        A Mono where, upon successful completion, emits the position of the channel. If an error is received, it is emitted through the Mono.
      • addMemberOverwrite

        public Mono<Void> addMemberOverwrite​(Snowflake memberId,
                                             PermissionOverwrite overwrite,
                                             @Nullable
                                             String reason)
        Description copied from interface: GuildChannel
        Requests to add a permission overwrite for the given member while optionally specifying a reason.
        Specified by:
        addMemberOverwrite in interface GuildChannel
        Parameters:
        memberId - The ID of the member to add the overwrite for.
        overwrite - The overwrite to add.
        reason - The reason, if present.
        Returns:
        A Mono where, upon successful completion, emits nothing; If an error is received, it is emitted through the Mono.
      • addRoleOverwrite

        public Mono<Void> addRoleOverwrite​(Snowflake roleId,
                                           PermissionOverwrite overwrite,
                                           @Nullable
                                           String reason)
        Description copied from interface: GuildChannel
        Requests to add a permission overwrite for the given role while optionally specifying a reason.
        Specified by:
        addRoleOverwrite in interface GuildChannel
        Parameters:
        roleId - The ID of the role to add the overwrite for.
        overwrite - The overwrite to add.
        reason - The reason, if present.
        Returns:
        A Mono where, upon successful completion, emits nothing; If an error is received, it is emitted through the Mono.
      • getId

        public final 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.
      • getType

        public final Channel.Type getType()
        Description copied from interface: Channel
        Gets the type of channel.
        Specified by:
        getType in interface Channel
        Returns:
        The type of channel.
      • delete

        public final Mono<Void> delete​(@Nullable
                                       String reason)
        Description copied from interface: Channel
        Requests to delete this channel while optionally specifying a reason.
        Specified by:
        delete in interface Channel
        Parameters:
        reason - The reason, if present.
        Returns:
        A Mono where, upon successful completion, emits nothing; indicating the channel has been deleted. If an error is received, it is emitted through the Mono.
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class Object