guild

package
v0.0.0-...-8fd61c5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 1, 2024 License: BSD-3-Clause Imports: 8 Imported by: 17

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Id   string `json:"id"`
	Name string `json:"name"`
}

type Ban

type Ban struct {
	Reason string    `json:"reason,omitempty"`
	User   user.User `json:"user"`
}

type CachedGuild

type CachedGuild struct {
	Id                          uint64                    `json:"id"`
	Name                        string                    `json:"name"`
	Icon                        string                    `json:"icon"`
	Splash                      string                    `json:"splash"`
	Owner                       bool                      `json:"owner"`
	OwnerId                     uint64                    `json:"owner_id"`
	Permissions                 uint64                    `json:"permissions"`
	Region                      string                    `json:"region"`
	AfkChannelId                objects.NullableSnowflake `json:"afk_channel_id"`
	AfkTimeout                  int                       `json:"afk_timeout"`
	VerificationLevel           int                       `json:"verification_level"`
	DefaultMessageNotifications int                       `json:"default_message_notifications"`
	ExplicitContentFilter       int                       `json:"explicit_content_filter"`
	Roles                       []uint64                  `json:"-"`
	Emojis                      []uint64                  `json:"-"`
	Features                    []GuildFeature            `json:"features"`
	MfaLevel                    int                       `json:"mfa_level"`
	ApplicationId               objects.NullableSnowflake `json:"application_id"`
	WidgetEnabled               bool                      `json:"widget_enabled"`
	WidgetChannelId             objects.NullableSnowflake `json:"widget_channel_id"`
	SystemChannelId             objects.NullableSnowflake `json:"system_channel_id"`
	SystemChannelFlags          uint8                     `json:"system_channel_flags"`
	RulesChannelId              objects.NullableSnowflake `json:"rules_channel_id,omitempty"`
	JoinedAt                    time.Time                 `json:"joined_at"`
	Large                       bool                      `json:"large"`
	Unavailable                 *bool                     `json:"unavailable"`
	MemberCount                 int                       `json:"member_count"`
	Channels                    []uint64                  `json:"-"`
	Presences                   []uint64                  `json:"-"`
	MaxPresences                int                       `json:"max_presences"`
	MaxMembers                  int                       `json:"max_members"`
	VanityUrlCode               string                    `json:"vanity_url_code"`
	Description                 string                    `json:"description"`
	Banner                      string                    `json:"banner"`
	PremiumTier                 PremiumTier               `json:"premium_tier"`
	PremiumSubscriptionCount    int                       `json:"premium_subscription_count"`
	PreferredLocale             string                    `json:"preferred_locale"`
	PublicUpdatesChannelId      objects.NullableSnowflake `json:"public_updates_channel_id"`
	MaxVideoChannelUsers        int                       `json:"max_video_channel_users"`
}

func (*CachedGuild) ToGuild

func (g *CachedGuild) ToGuild(guildId uint64) Guild

type CachedRole

type CachedRole struct {
	GuildId     uint64 `json:"-"` // Don't include in postgres
	Name        string `json:"name"`
	Color       int    `json:"color"`
	Hoist       bool   `json:"hoist"`
	Position    int    `json:"position"`
	Permissions uint64 `json:"permissions,string"`
	Managed     bool   `json:"managed"`
	Mentionable bool   `json:"mentionable"`
}

func (*CachedRole) ToRole

func (r *CachedRole) ToRole(roleId uint64) Role

type CachedVoiceState

type CachedVoiceState struct {
	ChannelId uint64 `json:"channel_id"`
	SessionId string `json:"session_id"`
	Deaf      bool   `json:"deaf"`
	Mute      bool   `json:"mute"`
	SelfDeaf  bool   `json:"self_deaf"`
	SelfMute  bool   `json:"self_mute"`
	Suppress  bool   `json:"suppress"`
}

func (*CachedVoiceState) ToVoiceState

func (s *CachedVoiceState) ToVoiceState(guildId uint64, m member.Member) VoiceState

type DefaultMessageNotificationLevel

type DefaultMessageNotificationLevel int
const (
	DefaultMessageNotificationLevelAllMessages  DefaultMessageNotificationLevel = 0
	DefaultMessageNotificationLevelOnlyMengions DefaultMessageNotificationLevel = 1
)

type ExplicitContentFilterLevel

type ExplicitContentFilterLevel int
const (
	DISABLED              ExplicitContentFilterLevel = 0
	MEMBERS_WITHOUT_ROLES ExplicitContentFilterLevel = 1
	ALL_MEMBERS           ExplicitContentFilterLevel = 2
)

type Guild

type Guild struct {
	Id                          uint64                    `json:"id,string"`
	Name                        string                    `json:"name"`
	Icon                        string                    `json:"icon"`
	Splash                      string                    `json:"splash"`
	Owner                       bool                      `json:"owner"`
	OwnerId                     uint64                    `json:"owner_id,string"`
	Permissions                 uint64                    `json:"permissions,string"`
	Region                      string                    `json:"region"`
	AfkChannelId                objects.NullableSnowflake `json:"afk_channel_id"`
	AfkTimeout                  int                       `json:"afk_timeout"`
	VerificationLevel           int                       `json:"verification_level"`
	DefaultMessageNotifications int                       `json:"default_message_notifications"`
	ExplicitContentFilter       int                       `json:"explicit_content_filter"`
	Roles                       []Role                    `json:"roles"`
	Emojis                      []emoji.Emoji             `json:"emojis"`
	Features                    []GuildFeature            `json:"features"`
	MfaLevel                    int                       `json:"mfa_level"`
	ApplicationId               objects.NullableSnowflake `json:"application_id"`
	WidgetEnabled               bool                      `json:"widget_enabled"`
	WidgetChannelId             objects.NullableSnowflake `json:"widget_channel_id"`
	SystemChannelId             objects.NullableSnowflake `json:"system_channel_id"`
	SystemChannelFlags          uint8                     `json:"system_channel_flags"`
	RulesChannelId              objects.NullableSnowflake `json:"rules_channel_id,omitempty"`
	JoinedAt                    time.Time                 `json:"joined_at"`
	Large                       bool                      `json:"large"`
	Unavailable                 *bool                     `json:"unavailable"`
	MemberCount                 int                       `json:"member_count"`
	VoiceStates                 []VoiceState              `json:"voice_state"`
	Members                     []member.Member           `json:"members"`
	Channels                    []channel.Channel         `json:"channels"`
	Threads                     []channel.Channel         `json:"threads"`
	MaxPresences                int                       `json:"max_presences"`
	MaxMembers                  int                       `json:"max_members"`
	VanityUrlCode               string                    `json:"vanity_url_code"`
	Description                 string                    `json:"description"`
	Banner                      string                    `json:"banner"`
	PremiumTier                 PremiumTier               `json:"premium_tier"`
	PremiumSubscriptionCount    int                       `json:"premium_subscription_count"`
	PreferredLocale             string                    `json:"preferred_locale"`
	PublicUpdatesChannelId      objects.NullableSnowflake `json:"public_updates_channel_id"`
	MaxVideoChannelUsers        int                       `json:"max_video_channel_users"`
	ApproximateMemberCount      int                       `json:"approximate_member_count"`   // Returned on GET /guild/:id
	ApproximatePresenceCount    int                       `json:"approximate_presence_count"` // Returned on GET /guild/:id
	WelcomeScreen               WelcomeScreen             `json:"welcome_screen"`
	Nsfw                        bool                      `json:"nsfw"`
}

func (*Guild) IconUrl

func (g *Guild) IconUrl() string

func (*Guild) ToCachedGuild

func (g *Guild) ToCachedGuild() (cached CachedGuild)

type GuildEmbed

type GuildEmbed struct {
	Enabled   bool   `json:"enabled"`
	ChannelId uint64 `json:"channel_id,string"`
}

type GuildFeature

type GuildFeature string
const (
	GuildFeatureInviteSplash   GuildFeature = "INVITE_SPLASH"
	GuildFeatureVipRegions     GuildFeature = "VIP_REGIONS" // guild has access to set 384kbps bitrate in voice (previously VIP voice servers)
	GuildFeatureVanityUrl      GuildFeature = "VANITY_URL"
	GuildFeatureVerified       GuildFeature = "VERIFIED"
	GuildFeaturePartnered      GuildFeature = "PARTNERED"
	GuildFeaturePublic         GuildFeature = "PUBLIC"
	GuildFeatureCommerce       GuildFeature = "COMMERCE"
	GuildFeatureNews           GuildFeature = "NEWS"
	GuildFeatureDiscoverable   GuildFeature = "DISCOVERABLE"
	GuildFeatureFeaturable     GuildFeature = "FEATURABLE"
	GuildFeatureBanner         GuildFeature = "BANNER"
	GuildFeaturePublicDisabled GuildFeature = "PUBLIC_DISABLED"
)

type GuildPreview

type GuildPreview struct {
	Id                       uint64         `json:"id,string"`
	Name                     string         `json:"name"`
	Icon                     string         `json:"icon"`
	Splash                   string         `json:"splash"`
	DiscoverySplash          string         `json:"discovery_splash"`
	Emojis                   []emoji.Emoji  `json:"emojis"`
	Features                 []GuildFeature `json:"features"`
	ApproximateMemberCount   int            `json:"approximate_member_count"`
	ApproximatePresenceCount int            `json:"approximate_presence_count"`
	Description              string         `json:"description"`
}

type GuildWidget

type GuildWidget struct {
	Id            uint64            `json:"id,string"`
	Name          string            `json:"name"`
	InstantInvite string            `json:"instant_invite"`
	Channels      []channel.Channel `json:"channels"`
	Members       []member.Member   `json:"members"`
	PresenceCount int               `json:"presence_count"`
}

type PremiumTier

type PremiumTier int
const (
	PremiumTierNone PremiumTier = iota
	PremiumTier1
	PremiumTier2
	PremiumTier3
)

type Role

type Role struct {
	Id          uint64   `json:"id,string"`
	Name        string   `json:"name"`
	Color       int      `json:"color"`
	Hoist       bool     `json:"hoist"`
	Position    int      `json:"position"`
	Permissions uint64   `json:"permissions,string"`
	Managed     bool     `json:"managed"`
	Mentionable bool     `json:"mentionable"`
	Tags        RoleTags `json:"tags"`
}

func (*Role) Mention

func (r *Role) Mention() string

func (*Role) ToCachedRole

func (r *Role) ToCachedRole(guildId uint64) CachedRole

type RoleTags

type RoleTags struct {
	BotId         *uint64 `json:"bot_id,string,omitempty"`
	IntegrationId *uint64 `json:"integration_id,string,omitempty"`
}

type VerificationLevel

type VerificationLevel int
const (
	NONE      VerificationLevel = 0
	LOW       VerificationLevel = 1
	MEDIUM    VerificationLevel = 2
	HIGH      VerificationLevel = 3
	VERY_HIGH VerificationLevel = 4
)

type VoiceRegion

type VoiceRegion struct {
	Id         string `json:"id"`
	Name       string `json:"name"`
	Vip        bool   `json:"vip"`
	Optimal    bool   `json:"optimal"`
	Deprecated bool   `json:"deprecated"`
	Custom     bool   `json:"custom"`
}

type VoiceState

type VoiceState struct {
	GuildId   uint64        `json:"guild_id,string"`
	ChannelId uint64        `json:"channel_id,string"`
	UserId    uint64        `json:"user_id,string"`
	Member    member.Member `json:"member"`
	SessionId string        `json:"session_id"`
	Deaf      bool          `json:"deaf"`
	Mute      bool          `json:"mute"`
	SelfDeaf  bool          `json:"self_deaf"`
	SelfMute  bool          `json:"self_mute"`
	Suppress  bool          `json:"suppress"`
}

func (*VoiceState) ToCachedVoiceState

func (s *VoiceState) ToCachedVoiceState() CachedVoiceState

type Webhook

type Webhook struct {
	Id            uint64                    `json:"id,string"`
	Type          WebhookType               `json:"type"`
	GuildId       uint64                    `json:"guild_id,string,omitempty"`
	ChannelId     uint64                    `json:"channel_id,string"`
	User          user.User                 `json:"user"`
	Name          string                    `json:"name,omitempty"`
	Avatar        string                    `json:"avatar,omitempty"`
	Token         string                    `json:"token,omitempty"`
	ApplicationId objects.NullableSnowflake `json:"application_id"`
}

type WebhookType

type WebhookType int
const (
	WebhookTypeIncoming        WebhookType = 1
	WebhookTypeChannelFollower WebhookType = 2
)

type WelcomeScreen

type WelcomeScreen struct {
	Description     string                 `json:"description"`
	WelcomeChannels []WelcomeScreenChannel `json:"welcome_channels"`
}

type WelcomeScreenChannel

type WelcomeScreenChannel struct {
	ChannelId   uint64                    `json:"channel_id,string"`
	Description string                    `json:"description"`
	EmojiId     objects.NullableSnowflake `json:"emoji_id"`
	EmojiName   *string                   `json:"emoji_name"`
}

type WidgetStyle

type WidgetStyle string
const (
	WidgetStyleShield  WidgetStyle = "shield"
	WidgetStyleBanner1 WidgetStyle = "banner1"
	WidgetStyleBanner2 WidgetStyle = "banner2"
	WidgetStyleBanner3 WidgetStyle = "banner3"
	WidgetStyleBanner4 WidgetStyle = "banner4"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL