All Known Subinterfaces:
GuildGroup, NamedGroup, NamedGuildGroup
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface Group
Specifies a group that users may belong to.

Note that group membership is not static, but rather may change between guilds and/or channels. This allows the definition of flexible permission groups that refer to different groups of people in different servers/channels.

Since:
1.0
Version:
1.0
  • Method Summary

    Modifier and Type
    Method
    Description
    Determines whether the user in the given context belongs to this group.
    default Mono<Boolean>
    Determines whether the given user belongs to this group in the context of the given guild and channel.
  • Method Details

    • belongs

      Determines whether the user in the given context belongs to this group.
      Parameters:
      context - The access context being checked.
      Returns:
      A Mono that issues true if the user belongs to this group under the context, or false otherwise.
      Implementation Requirements:
      Implementations should prefer using the monos provided by the context directly instead of obtaining them through other means (such as through the client), as the context is optimized when possible to reuse existing instances instead of issuing new API calls.
    • belongs

      @SideEffectFree default Mono<Boolean> belongs(User user, ChannelAccessContext context)
      Determines whether the given user belongs to this group in the context of the given guild and channel.
      Parameters:
      user - The user to check for.
      context - The access context being checked.
      Returns:
      A Mono that issues true if the user belongs to this group under the given context, or false otherwise.
      API Note:
      This is equivalent to using ChannelAccessContext.asUser(User) and delegating to belongs(ChannelAccessContext). The user in the given context is ignored.