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