GuildMemberFlags
A collection of multiple GuildMemberFlags.
Creating an instance of GuildMemberFlags
You can create an instance of GuildMemberFlags using the following methods:
// from individual GuildMemberFlags
val guildMemberFlags1 = GuildMemberFlags(GuildMemberFlag.DidRejoin, GuildMemberFlag.CompletedOnboarding)
// from an Iterable
val iterable: Iterable<GuildMemberFlag> = TODO()
val guildMemberFlags2 = GuildMemberFlags(iterable)
// using a builder
val guildMemberFlags3 = GuildMemberFlags {
+guildMemberFlags2
+GuildMemberFlag.DidRejoin
-GuildMemberFlag.CompletedOnboarding
}
Modifying an existing instance of GuildMemberFlags
You can create a modified copy of an existing instance of GuildMemberFlags using the copy method:
guildMemberFlags.copy {
+GuildMemberFlag.DidRejoin
}
Mathematical operators
All GuildMemberFlags objects can use +
/-
operators:
val guildMemberFlags1 = guildMemberFlags + GuildMemberFlag.DidRejoin
val guildMemberFlags2 = guildMemberFlags - GuildMemberFlag.CompletedOnboarding
val guildMemberFlags3 = guildMemberFlags1 + guildMemberFlags2
Checking for GuildMemberFlags
You can use the contains operator to check whether an instance of GuildMemberFlags contains specific GuildMemberFlags:
val hasGuildMemberFlag = GuildMemberFlag.DidRejoin in guildMemberFlags
val hasGuildMemberFlags = GuildMemberFlags(GuildMemberFlag.DidRejoin, GuildMemberFlag.CompletedOnboarding) in guildMemberFlags
Unknown GuildMemberFlags
Whenever GuildMemberFlags haven't been added to Kord yet, they will be deserialized as instances of GuildMemberFlag.Unknown.
You can also use GuildMemberFlag.fromShift to check for unknown GuildMemberFlags.
val hasUnknownGuildMemberFlag = GuildMemberFlag.fromShift(23) in guildMemberFlags
See also
Properties
A Set of all GuildMemberFlags contained in this instance of GuildMemberFlags.
Functions
Checks if this instance of GuildMemberFlags has all bits set that are set in flag.
Checks if this instance of GuildMemberFlags has all bits set that are set in flags.
Returns a copy of this instance of GuildMemberFlags modified with builder.
Returns an instance of GuildMemberFlags that has all bits set that are set in this
except the bits that are set in flag.
Returns an instance of GuildMemberFlags that has all bits set that are set in this
except the bits that are set in flags.
Returns an instance of GuildMemberFlags that has all bits set that are set in this
and flag.
Returns an instance of GuildMemberFlags that has all bits set that are set in this
and flags.