Skip to content

Commit

Permalink
modified permission getter for interaction perms
Browse files Browse the repository at this point in the history
  • Loading branch information
topi314 committed Jul 9, 2021
1 parent eedf505 commit e10263b
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions api/member.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,24 @@ import (

// Member is a discord GuildMember
type Member struct {
Disgo Disgo
GuildID Snowflake `json:"guild_id"`
User *User `json:"user"`
Nick *string `json:"nick"`
RoleIDs []Snowflake `json:"roles,omitempty"`
JoinedAt time.Time `json:"joined_at"`
PremiumSince *time.Time `json:"premium_since,omitempty"`
Deaf *bool `json:"deaf,omitempty"`
Mute *bool `json:"mute,omitempty"`
Pending bool `json:"pending"`
ChannelPermissions *Permissions `json:"permissions,omitempty"`
Disgo Disgo
GuildID Snowflake `json:"guild_id"`
User *User `json:"user"`
Nick *string `json:"nick"`
RoleIDs []Snowflake `json:"roles,omitempty"`
JoinedAt time.Time `json:"joined_at"`
PremiumSince *time.Time `json:"premium_since,omitempty"`
Deaf bool `json:"deaf,omitempty"`
Mute bool `json:"mute,omitempty"`
Pending bool `json:"pending"`
InteractionPermissions *Permissions `json:"permissions,omitempty"`
}

// Permissions returns the Permissions the Member has in the Guild
func (m *Member) Permissions() Permissions {
if m.InteractionPermissions != nil {
return *m.InteractionPermissions
}
return GetMemberPermissions(m)
}

Expand Down

0 comments on commit e10263b

Please sign in to comment.