Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide the same functions of Permissions to MessageFlags #203

Merged
merged 3 commits into from
Mar 10, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion common/src/main/kotlin/entity/DiscordMessage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ enum class MessageFlag(val code: Int) {
}

@Serializable(with = MessageFlags.Serializer::class)
data class MessageFlags internal constructor(val code: Int) {
class MessageFlags internal constructor(val code: Int) {

val flags = MessageFlag.values().filter { code and it.code != 0 }

Expand All @@ -307,6 +307,8 @@ data class MessageFlags internal constructor(val code: Int) {
return builder.flags()
}

override fun toString(): String = flags.toString()

companion object {
inline operator fun invoke(builder: Builder.() -> Unit): MessageFlags {
return Builder().apply(builder).flags()
Expand Down