From 202785c50b9ed7366f7b92c75fea6c5e0b37f69e Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Thu, 7 Mar 2024 16:51:22 +0100 Subject: [PATCH] feat(role): add flags (#1410) --------- Co-authored-by: Fedor Lapshin --- structs.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/structs.go b/structs.go index 0a0d38d..21fb3e5 100644 --- a/structs.go +++ b/structs.go @@ -1362,8 +1362,23 @@ type Role struct { // The emoji assigned to this role. UnicodeEmoji string `json:"unicode_emoji"` + + // The flags of the role, which describe its extra features. + // This is a combination of bit masks; the presence of a certain flag can + // be checked by performing a bitwise AND between this int and the flag. + Flags RoleFlags `json:"flags"` } +// RoleFlags represent the flags of a Role. +// https://discord.com/developers/docs/topics/permissions#role-object-role-flags +type RoleFlags int + +// Block containing known RoleFlags values. +const ( + // RoleFlagInPrompt indicates whether the Role is selectable by members in an onboarding prompt. + RoleFlagInPrompt RoleFlags = 1 << 0 +) + // Mention returns a string which mentions the role func (r *Role) Mention() string { return fmt.Sprintf("<@&%s>", r.ID)