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