Interface TopLevelGuildChannel

    • Method Detail

      • addMemberOverwrite

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

        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

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

        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.
      • getRawPosition

        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

        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.