Package dev.sympho.bot_utils.access
Interface Group
- 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.
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 TypeMethodDescriptionbelongs(ChannelAccessContext context) Determines whether the user in the given context belongs to this group.belongs(User user, ChannelAccessContext context) 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
trueif the user belongs to this group under the context, orfalseotherwise. - 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. Also note that the returned mono should never be empty.
-
belongs
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
trueif the user belongs to this group under the given context, orfalseotherwise. - API Note:
- This is equivalent to using
ChannelAccessContext.asUser(User)and delegating tobelongs(ChannelAccessContext). The user in the given context is ignored.
-