func (m *GuildMember) HasRole(id string) bool {
	for _, roleID := range m.Roles {
		if roleID == id {
			return true
		}
	}
	return false
}
HasRole returns whether this member has the given role.
Note that this method does not try to fetch this member latest roles, it instead looks
in the roles it already had when this member object was created.
package discord
import (
	"github.com/skwair/harmony/voice"
)
type GuildVerificationLevel int
const (
	GuildVerificationLevelNone GuildVerificationLevel = iota
	GuildVerificationLevelLow
	GuildVerificationLevelMedium
	GuildVerificationLevelHigh
	GuildVerificationLevelVeryHigh
)
type GuildExplicitContentFilter int
const (
	GuildExplicitContentFilterDisabled GuildExplicitContentFilter = iota
	GuildExplicitContentFilterWithoutRole
	GuildExplicitContentFilterAll
)
type GuildAFKTimeout int
const (
	GuildAFKTimeout1m  GuildAFKTimeout = 60
	GuildAFKTimeout5m  GuildAFKTimeout = 300
	GuildAFKTimeout15m GuildAFKTimeout = 900
	GuildAFKTimeout30m GuildAFKTimeout = 1800
	GuildAFKTimeout1h  GuildAFKTimeout = 3600
)
type GuildDefaultNotificationLevel int
const (
	GuildDefaultNotificationLevelAll GuildDefaultNotificationLevel = iota
	GuildDefaultNotificationLevelMentionOnly
)
type MFALevel int
const (
	MFALevelNone     MFALevel = 0
	MFALevelElevated MFALevel = 1
)
type PremiumTier int
const (
	PremiumTierNone PremiumTier = 0
	PremiumTier1    PremiumTier = 1
	PremiumTier2    PremiumTier = 2
	PremiumTier3    PremiumTier = 3
)
type SystemChannelFlag int
const (
	SystemChannelFlagSupressJoinNotifications    SystemChannelFlag = 1 << 0
	SystemChannelFlagSupressPremiumSubscriptions SystemChannelFlag = 1 << 1
)
type GuildFeature string
const (
	GuildFeatureInviteSplash         = "INVITE_SPLASH"
	GuildFeatureVIPRegions           = "VIP_REGIONS"
	GuildFeatureVanityURL            = "VANITY_URL"
	GuildFeatureVerified             = "VERIFIED"
	GuildFeaturePartenered           = "PARTNERED"
	GuildFeatureCommunity            = "COMMUNITY"
	GuildFeatureCommerce             = "COMMERCE"
	GuildFeatureNews                 = "NEWS"
	GuildFeatureDiscoverable         = "DISCOVERABLE"
	GuildFeatureFeaturable           = "FEATURABLE"
	GuildFeatureAnimatedIcon         = "ANIMATED_ICON"
	GuildFeatureBanner               = "BANNER"
	GuildFeatureWelcomeScreenEnabled = "WELCOME_SCREEN_ENABLED"
)
type Guild struct {
	ID                          string                        `json:"id"`
	Name                        string                        `json:"name"`
	Icon                        string                        `json:"icon"`
	Splash                      string                        `json:"splash"`
	DiscoverySplash             string                        `json:"discovery_splash"`
	Description                 string                        `json:"description"`
	Banner                      string                        `json:"banner"`
	OwnerID                     string                        `json:"owner_id"`
	Region                      string                        `json:"region"`
	AFKChannelID                string                        `json:"afk_channel_id"`
	AFKTimeout                  GuildAFKTimeout               `json:"afk_timeout"`
	VerificationLevel           GuildVerificationLevel        `json:"verification_level"`
	DefaultMessageNotifications GuildDefaultNotificationLevel `json:"default_message_notifications"`
	ExplicitContentFilter       GuildExplicitContentFilter    `json:"explicit_content_filter"`
	Roles                       []Role                        `json:"roles"`
	Emojis                      []Emoji                       `json:"emojis"`
	Features                    []string                      `json:"features"`
	MFALevel                    MFALevel                      `json:"mfa_level"`
	ApplicationID               string                        `json:"application_id"`
	PreferredLocale             string                        `json:"preferred_locale"`
	WidgetEnabled               bool                          `json:"widget_enabled"`
	WidgetChannelID             string                        `json:"widget_channel_id"`
	SystemChannelID             string                        `json:"system_channel_id"`
	SystemChannelFlags          SystemChannelFlag             `json:"system_channel_flags"`
	RulesChannelID              string                        `json:"rules_channel_id"`
	PublicUpdatesChannelID      string                        `json:"public_updates_channel_id"`
	VanityURLCode               string                        `json:"vanity_url_code"`
	PremiumTier                 PremiumTier                   `json:"premium_tier"`
	PremiumSubscriptionCount    int                           `json:"premium_subscription_count"`
	MaxMembers                  int                           `json:"max_members"`
	MaxVideoChannelUsers        int                           `json:"max_video_channel_users"`
	Owner       bool `json:"owner"`
	Permissions int  `json:"permissions,string"`
	JoinedAt    Time          `json:"joined_at"`
	Large       bool          `json:"large"`
	Unavailable bool          `json:"unavailable"`
	MemberCount int           `json:"member_count"`
	VoiceStates []voice.State `json:"voice_states"`
	Members     []GuildMember `json:"members"`
	Channels    []Channel     `json:"channels"`
	Presences   []Presence    `json:"presences"`
}
type PartialGuild struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Icon        string `json:"icon"`
	Owner       bool   `json:"owner"`
	Permissions int    `json:"permissions,string"`
}
type UnavailableGuild struct {
	ID          string `json:"id"`
	Unavailable *bool  `json:"unavailable"`  
}
type GuildMember struct {
	User         *User    `json:"user"`
	Nick         string   `json:"nick"`
	Roles        []string `json:"roles"`  
	JoinedAt     Time     `json:"joined_at"`
	PremiumSince Time     `json:"premium_since"`
	Deaf         bool     `json:"deaf"`
	Mute         bool     `json:"mute"`
}
func (m *GuildMember) PermissionsIn(g *Guild, ch *Channel) (permissions int) {
	base := computeBasePermissions(g, m)
	return computeOverwrites(ch, m, base)
}