Skip to content

Commit

Permalink
feat(role): add flags (#1410)
Browse files Browse the repository at this point in the history
---------

Co-authored-by: Fedor Lapshin <[email protected]>
  • Loading branch information
Earlopain and FedorLap2006 authored Mar 7, 2024
1 parent 384ff4e commit 202785c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 202785c

Please sign in to comment.