SpeakingFlags
A collection of multiple SpeakingFlags.
Creating an instance of SpeakingFlags
You can create an instance of SpeakingFlags using the following methods:
// from individual SpeakingFlags
val speakingFlags1 = SpeakingFlags(SpeakingFlag.Microphone, SpeakingFlag.Soundshare)
// from an Iterable
val iterable: Iterable<SpeakingFlag> = TODO()
val speakingFlags2 = SpeakingFlags(iterable)
// using a builder
val speakingFlags3 = SpeakingFlags {
+speakingFlags2
+SpeakingFlag.Microphone
-SpeakingFlag.Soundshare
}
Modifying an existing instance of SpeakingFlags
You can create a modified copy of an existing instance of SpeakingFlags using the copy method:
speakingFlags.copy {
+SpeakingFlag.Microphone
}
Mathematical operators
All SpeakingFlags objects can use +
/-
operators:
val speakingFlags1 = speakingFlags + SpeakingFlag.Microphone
val speakingFlags2 = speakingFlags - SpeakingFlag.Soundshare
val speakingFlags3 = speakingFlags1 + speakingFlags2
Checking for SpeakingFlags
You can use the contains operator to check whether an instance of SpeakingFlags contains specific SpeakingFlags:
val hasSpeakingFlag = SpeakingFlag.Microphone in speakingFlags
val hasSpeakingFlags = SpeakingFlags(SpeakingFlag.Microphone, SpeakingFlag.Soundshare) in speakingFlags
Unknown SpeakingFlags
Whenever SpeakingFlags haven't been added to Kord yet, they will be deserialized as instances of SpeakingFlag.Unknown.
You can also use SpeakingFlag.fromShift to check for unknown SpeakingFlags.
val hasUnknownSpeakingFlag = SpeakingFlag.fromShift(23) in speakingFlags
See also
Properties
Functions
Checks if this instance of SpeakingFlags has all bits set that are set in flag.
Checks if this instance of SpeakingFlags has all bits set that are set in flags.
Returns a copy of this instance of SpeakingFlags modified with builder.
Returns an instance of SpeakingFlags that has all bits set that are set in this
except the bits that are set in flag.
Returns an instance of SpeakingFlags that has all bits set that are set in this
except the bits that are set in flags.
Returns an instance of SpeakingFlags that has all bits set that are set in this
and flag.
Returns an instance of SpeakingFlags that has all bits set that are set in this
and flags.