types

package
v0.0.0-...-3d4fb19 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GuildFeatureAnimatedIcon                  = "ANIMATED_ICON"
	GuildFeatureBanner                        = "BANNER"
	GuildFeatureCommerce                      = "COMMERCE"
	GuildFeatureCommunity                     = "COMMUNITY"
	GuildFeatureDiscoverable                  = "DISCOVERABLE"
	GuildFeatureFeaturable                    = "FEATURABLE"
	GuildFeatureInviteSplash                  = "INVITE_SPLASH"
	GuildFeatureMemberVerificationGateEnabled = "MEMBER_VERIFICATION_GATE_ENABLED"
	GuildFeatureMonetizationEnabled           = "MONETIZATION_ENABLED"
	GuildFeatureMoreStickers                  = "MORE_STICKERS"
	GuildFeatureNews                          = "NEWS"
	GuildFeaturePartnered                     = "PARTNERED"
	GuildFeaturePreviewEnabled                = "PREVIEW_ENABLED"
	GuildFeaturePrivateThreads                = "PRIVATE_THREADS"
	GuildFeatureRoleIcons                     = "ROLE_ICONS"
	GuildFeatureSevenDayThreadArchive         = "SEVEN_DAY_THREAD_ARCHIVE"
	GuildFeatureThreeDayThreadArchive         = "THREE_DAY_THREAD_ARCHIVE"
	GuildFeatureTicketedEventsEnabled         = "TICKETED_EVENTS_ENABLED"
	GuildFeatureVanityURL                     = "VANITY_URL"
	GuildFeatureVerified                      = "VERIFIED"
	GuildFeatureVIPRegions                    = "VIP_REGIONS"
	GuildFeatureWelcomeScreenEnabled          = "WELCOME_SCREEN_ENABLED"
)

Variables

This section is empty.

Functions

func NewError

func NewError(res *http.Response) error

NewError creates a new Error from an http.Response

Types

type Activity

type Activity struct {
	Name string       `json:"name"`
	Type ActivityType `json:"type"`
	URL  null.String  `json:"url,omitempty"`
}

type ActivityType

type ActivityType int
const (
	ActivityTypeGame ActivityType = iota
	ActivityTypeStreaming
	ActivityTypeListening
	ActivityTypeWatching
	ActivityTypeCustom
	ActivityTypeCompeting
)

type ApplicationCommand

type ApplicationCommand struct {
	ID            string                 `json:"id"`
	Type          ApplicationCommandType `json:"type"`
	ApplicationID string                 `json:"application_id"`
	GuildID       string                 `json:"guild_id"`
	Name          string                 `json:"name"`
	Description   string                 `json:"description"`

	DefaultPermission bool   `json:"default_permission,omitempty"`
	Version           string `json:"version"`
}

type ApplicationCommandInteractionDataOption

type ApplicationCommandInteractionDataOption struct {
	Name    string                                     `json:"name"`
	Type    ApplicationCommandOptionType               `json:"type"`
	Value   interface{}                                `json:"value,omitempty"`
	Options []*ApplicationCommandInteractionDataOption `json:"options,omitempty"`
	Focused bool                                       `json:"focused,omitempty"`
}

type ApplicationCommandOption

type ApplicationCommandOption struct {
	Type         ApplicationCommandOptionType      `json:"type"`
	Name         string                            `json:"name"`
	Description  string                            `json:"description"`
	Required     bool                              `json:"required,omitempty"`
	Choices      []*ApplicationCommandOptionChoice `json:"choices,omitempty"`
	Options      []*ApplicationCommandOption       `json:"options,omitempty"`
	ChannelTypes []ChannelType                     `json:"channel_types,omitempty"`
	MinValue     float64                           `json:"min_value,omitempty"`
	MaxValue     float64                           `json:"max_value,omitempty"`
	Autocomplete bool                              `json:"autocomplete,omitempty"`
}

type ApplicationCommandOptionChoice

type ApplicationCommandOptionChoice struct {
	Name  string      `json:"name"`
	Value interface{} `json:"value"`
}

func (*ApplicationCommandOptionChoice) Double

func (*ApplicationCommandOptionChoice) Integer

func (c *ApplicationCommandOptionChoice) Integer() int

func (*ApplicationCommandOptionChoice) String

type ApplicationCommandOptionType

type ApplicationCommandOptionType int
const (
	ApplicationCommandOptionTypeSubCommand ApplicationCommandOptionType = iota + 1
	ApplicationCommandOptionTypeSubCommandGroup
	ApplicationCommandOptionTypeString
	ApplicationCommandOptionTypeInteger
	ApplicationCommandOptionTypeBoolean
	ApplicationCommandOptionTypeUser
	ApplicationCommandOptionTypeChannel
	ApplicationCommandOptionTypeRole
	ApplicationCommandOptionTypeMentionable
	ApplicationCommandOptionTypeNumber
	ApplicationCommandOptionTypeAttachment
)

type ApplicationCommandType

type ApplicationCommandType int
const (
	ApplicationCommandTypeChatInput ApplicationCommandType = iota + 1
	ApplicationCommandTypeUser
	ApplicationCommandTypeMessage
)

type Attachment

type Attachment struct {
	ID          string   `json:"id"`
	Filename    string   `json:"filename"`
	ContentType string   `json:"content_type,omitempty"`
	URL         string   `json:"url"`
	Height      null.Int `json:"height,omitempty"`
	Width       null.Int `json:"width,omitempty"`
}

type ButtonStyle

type ButtonStyle int
const (
	ButtonStylePrimary ButtonStyle = iota + 1
	ButtonStyleSeconday
	ButtonStyleSuccess
	ButtonStyleDanger
	ButtonStyleLink
)

type Channel

type Channel struct {
	ID                         string           `json:"id"`
	Type                       ChannelType      `json:"type"`
	GuildID                    string           `json:"guild_id,omitempty"`
	Position                   int              `json:"position,omitempty"`
	PermissionOverwrites       []*Overwrite     `json:"permission_overwrites,omitempty"`
	Name                       string           `json:"name,omitempty"`
	Topic                      null.String      `json:"topic,omitempty"`
	NSFW                       bool             `json:"nsfw,omitempty"`
	LastMessageID              null.String      `json:"last_message_id"`
	Bitrate                    int              `json:"bitrate,omitempty"`
	UserLimit                  int              `json:"user_limit,omitempty"`
	RateLimitPerUser           int              `json:"rate_limit_per_user,omitempty"`
	Recipients                 []*User          `json:"recipients,omitempty"`
	Icon                       null.String      `json:"icon,omitempty"`
	OwnerID                    string           `json:"owner_id,omitempty"`
	ApplicationID              string           `json:"application_id,omitempty"`
	ParentID                   null.String      `json:"parent_id,omitempty"`
	LastPinTimestamp           Time             `json:"last_pin_timestamp,omitempty"`
	RTCRegion                  null.String      `json:"rtc_region,omitempty"`
	VideoQualityMode           VideoQualityMode `json:"video_quality_mode,omitempty"`
	MessageCount               int              `json:"message_count,omitempty"`
	MemberCount                int              `json:"member_count,omitempty"`
	ThreadMetadata             *ThreadMetadata  `json:"thread_metadata,omitempty"`
	Member                     *ThreadMember    `json:"thread_member,omitempty"`
	DefaultAutoArchiveDuration int              `json:"default_auto_archive_duration,omitempty"`
	Permissions                string           `json:"permissions,omitempty"`
}

type ChannelMention

type ChannelMention struct {
	ID      string      `json:"id"`
	GuildID string      `json:"guild_id"`
	Type    ChannelType `json:"type"`
	Name    string      `json:"name"`
}

type ChannelType

type ChannelType int
const (
	ChannelTypeGuildText ChannelType = iota
	ChannelTypeDM
	ChannelTypeGuildVoice
	ChannelTypeGuildCategory
	ChannelTypeGuildNews
	ChannelTypeGuildStore
	ChannelTypeGuildNewsThread
	ChannelTypeGuildPublicThread
	ChannelTypePrivateThread
	ChannelTypeStageVoice
)

type Component

type Component struct {
	Type        ComponentType   `json:"type"`
	CustomID    string          `json:"custom_id,omitempty"`
	Disabled    bool            `json:"disabled,omitempty"`
	Style       ButtonStyle     `json:"style,omitempty"`
	Label       string          `json:"label,omitempty"`
	Emoji       *Emoji          `json:"emoji,omitempty"`
	URL         string          `json:"url,omitempty"`
	Options     []*SelectOption `json:"options,omitempty"`
	Placeholder string          `json:"placeholder,omitempty"`
	MinValues   int             `json:"min_values,omitempty"`
	MaxValues   int             `json:"max_values,omitempty"`
	Components  []Component     `json:"components,omitempty"`
	MinLength   int             `json:"min_length,omitempty"`
	MaxLength   int             `json:"max_length,omitempty"`
	Required    bool            `json:"required,omitempty"`
	Value       string          `json:"value,omitempty"`
}

type ComponentType

type ComponentType int
const (
	ComponentTypeActionRow ComponentType = iota + 1
	ComponentTypeButton
	ComponentTypeSelectMenu
	ComponentTypeTextInput
)

type DefaultMessageNotificationLevel

type DefaultMessageNotificationLevel int
const (
	DefaultMessageNotificationLevelAllMessages DefaultMessageNotificationLevel = iota
	DefaultMessageNotificationLevelOnlyMentions
)

type Embed

type Embed struct {
	Title       string        `json:"title,omitempty"`
	Description string        `json:"description,omitempty"`
	URL         string        `json:"url,omitempty"`
	Timestamp   Time          `json:"time,omitempty"`
	Color       int           `json:"color,omitempty"`
	Footer      *EmbedFooter  `json:"footer,omitempty"`
	Image       *EmbedImage   `json:"image,omitempty"`
	Author      *EmbedAuthor  `json:"author,omitempty"`
	Fields      []*EmbedField `json:"fields,omitempty"`
}

type EmbedAuthor

type EmbedAuthor struct {
	Name         string `json:"name"`
	URL          string `json:"url,omitempty"`
	IconURL      string `json:"icon_url,omitempty"`
	ProxyIconURL string `json:"proxy_icon_url,omitempty"`
}

type EmbedField

type EmbedField struct {
	Name   string `json:"name"`
	Value  string `json:"value"`
	Inline bool   `json:"inline,omitempty"`
}

type EmbedFooter

type EmbedFooter struct {
	Text         string `json:"text"`
	IconURL      string `json:"icon_url,omitempty"`
	ProxyIconURL string `json:"proxy_icon_url,omitempty"`
}

type EmbedImage

type EmbedImage struct {
	URL      string `json:"url"`
	ProxyURL string `json:"proxy_url,omitempty"`
}

type Emoji

type Emoji struct {
	ID            string      `json:"id"`
	Name          null.String `json:"name"`
	Roles         []string    `json:"roles,omitempty"`
	User          *User       `json:"user,omitempty"`
	RequireColons bool        `json:"require_colons,omitempty"`
	Managed       bool        `json:"managed,omitempty"`
	Animated      bool        `json:"animated,omitempty"`
	Available     bool        `json:"available,omitempty"`
}

type Error

type Error struct {
	StatusCode int                    `json:"-"`
	Code       int                    `json:"code"`
	Message    string                 `json:"message"`
	Errors     map[string]interface{} `json:"errors"`
}

func (*Error) Error

func (e *Error) Error() string

type ExplicitContentFilterLevel

type ExplicitContentFilterLevel int
const (
	ExplicitContentFilterLevelDisabled ExplicitContentFilterLevel = iota
	ExplicitContentFilterLevelMembersWithoutRoles
	ExplicitContentFilterLevelAllMembers
)

type GatewayIntent

type GatewayIntent int
const (
	GatewayIntentGuilds                 GatewayIntent = 1 << 0
	GatewayIntentGuildMembers           GatewayIntent = 1 << 1
	GatewayIntentGuildBans              GatewayIntent = 1 << 2
	GatewayIntentGuildEmojisAndStickers GatewayIntent = 1 << 3
	GatewayIntentGuildIntegrations      GatewayIntent = 1 << 4
	GatewayIntentGuildWebhooks          GatewayIntent = 1 << 5
	GatewayIntentGuildInvites           GatewayIntent = 1 << 6
	GatewayIntentGuildVoiceStates       GatewayIntent = 1 << 7
	GatewayIntentGuildPresences         GatewayIntent = 1 << 8
	GatewayIntentGuildMessages          GatewayIntent = 1 << 9
	GatewayIntentGuildMessageReactions  GatewayIntent = 1 << 10
	GatewayIntentGuildMessageTyping     GatewayIntent = 1 << 11
	GatewayIntentGuildScheduledEvents   GatewayIntent = 1 << 16

	GatewayIntentDirectMessages         GatewayIntent = 1 << 12
	GatewayIntentDirectMessageReactions GatewayIntent = 1 << 13
	GatewayIntentDirectMessageTyping    GatewayIntent = 1 << 14
)

type Guild

type Guild struct {
	ID                          string                          `json:"id"`
	Name                        string                          `json:"name"`
	Icon                        null.String                     `json:"icon"`
	IconHash                    null.String                     `json:"icon_hash,omitempty"`
	Splash                      null.String                     `json:"splash"`
	DiscoverySplash             null.String                     `json:"discovery_splash"`
	Owner                       bool                            `json:"owner,omitempty"`
	OwnerID                     string                          `json:"owner_id,omitempty"`
	Permissions                 string                          `json:"permissions,omitempty"`
	Region                      null.String                     `json:"region,omitempty"`
	AFKChannelID                null.String                     `json:"afk_channel_id"`
	AFKTimeout                  int                             `json:"afk_timeout"`
	WidgetEnabled               bool                            `json:"widget_enabled,omitempty"`
	WidgetChannelID             null.String                     `json:"widget_channe_id,omitempty"`
	VerificationLevel           VerificationLevel               `json:"verification_level"`
	DefaultMessageNotifications DefaultMessageNotificationLevel `json:"default_message_notifications"`
	ExplicitContentFilter       ExplicitContentFilterLevel      `json:"explicit_content_filter"`
	Roles                       []*Role                         `json:"roles"`
	Emojis                      []*Emoji                        `json:"emojis"`
	Features                    []GuildFeature                  `json:"features"`
	MFALevel                    MFALevel                        `json:"mfa_level"`
	ApplicationID               null.String                     `json:"application_id"`
	SystemChannelID             null.String                     `json:"system_channel_id"`
	SystemChannelFlags          SystemChannelFlag               `json:"system_channel_flags"`
	RulesChannelID              null.String                     `json:"rules_channel_id"`
	JoinedAt                    Time                            `json:"joined_at,omitempty"`
	Large                       bool                            `json:"large,omitempty"`
	Unavailable                 bool                            `json:"unavailable,omitempty"`
	MemberCount                 int                             `json:"member_count,omitempty"`
	// VoiceStates []*VoiceState `json:"voice_states,omitempty"`
	Members                  []*GuildMember `json:"members,omitempty"`
	Channels                 []*Channel     `json:"channels,omitempty"`
	Threads                  []*Channel     `json:"threads,omitempty"`
	Presences                []*Presence    `json:"presences,omitempty"`
	MaxPresences             null.Int       `json:"max_presences,omitempty"`
	MaxMembers               int            `json:"max_members,omitempty"`
	VanityURLCode            null.String    `json:"vanity_url_code"`
	Description              null.String    `json:"description"`
	Banner                   null.String    `json:"banner"`
	PremiumTier              PremiumTier    `json:"premium_tier,omitempty"`
	PremiumSubscriptionCount int            `json:"premium_subscription_count"`
	PreferredLocale          string         `json:"preferred_locale,omitempty"`
	PublicUpdatesChannelID   null.String    `json:"public_updates_channel_id"`
	MaxVideoChannelUsers     int            `json:"max_video_channel_users,omitempty"`
	ApproximateMemberCount   int            `json:"approximate_member_count,omitempty"`
	ApproximatePresenceCount int            `json:"approximate_presence_count,omitempty"`
	NSFWLevel                GuildNSFWLevel `json:"nsfw_level"`
}

type GuildFeature

type GuildFeature string

type GuildMember

type GuildMember struct {
	User                       *User       `json:"user,omitempty"`
	Nick                       null.String `json:"nick,omitempty"`
	Avatar                     null.String `json:"avatar,omitempty"`
	Roles                      []string    `json:"roles"`
	JoinedAt                   Time        `json:"joined_at"`
	PremiumSince               Time        `json:"premium_since"`
	Deaf                       bool        `json:"deaf"`
	Mute                       bool        `json:"mute"`
	Pending                    bool        `json:"pending,omitempty"`
	Permissions                string      `json:"permissions,omitempty"`
	CommunicationDisabledUntil Time        `json:"communication_disabled_until,omitempty"`
}

type GuildNSFWLevel

type GuildNSFWLevel int
const (
	GuildNSFWLevelDefault GuildNSFWLevel = iota
	GuildNSFWLevelExplicit
	GuildNSFWLevelSafe
	GuildNSFWLevelAgeRestricted
)

type Interaction

type Interaction struct {
	ID            string          `json:"id"`
	ApplicationID string          `json:"application_id"`
	Type          InteractionType `json:"type"`
}

type InteractionData

type InteractionData struct {
	ID            string                                     `json:"id"`
	Name          string                                     `json:"name"`
	Type          ApplicationCommandType                     `json:"type"`
	Resolved      *ResolvedData                              `json:"resolved,omitempty"`
	Options       []*ApplicationCommandInteractionDataOption `json:"options,omitempty"`
	CustomID      string                                     `json:"custom_id,omitempty"`
	ComponentType ComponentType                              `json:"component_type,omitempty"`
	Values        []*SelectOption                            `json:"values,omitempty"`
	TargetID      string                                     `json:"target_id,omitempty"`
	Components    []*Component                               `json:"components,omitempty"`
}

type InteractionType

type InteractionType int
const (
	InteractionTypePing InteractionType = iota + 1
	InteractionTypeApplicationCommand
	InteractionTypeMessageComponent
	InteractionTypeApplicationCommandAutocomplete
	InteractionTypeModalSubmit
)

type MFALevel

type MFALevel int
const (
	MFALevelNone MFALevel = iota
	MFALevelElevated
)

type Message

type Message struct {
	ID                string              `json:"id"`
	ChannelID         string              `json:"channel_id"`
	GuildID           string              `json:"guild_id"`
	Author            *User               `json:"author"`
	Member            *GuildMember        `json:"member,omitempty"`
	Content           string              `json:"content"`
	Timestamp         Time                `json:"timestamp"`
	EditedTimestamp   Time                `json:"edited_timestamp"`
	TTS               bool                `json:"tts"`
	MentionEveryone   bool                `json:"mention_everyone"`
	Mentions          []*MessageMention   `json:"mentions"`
	MentionRoles      []string            `json:"mention_roles"`
	MentionChannels   []*ChannelMention   `json:"mention_channels,omitempty"`
	Attachments       []*Attachment       `json:"attachments"`
	Embeds            []*Embed            `json:"embeds"`
	Reactions         []*Reaction         `json:"reaction,omitempty"`
	Pinned            bool                `json:"pinned"`
	WebhookID         string              `json:"webhook_id,omitempty"`
	Type              MessageType         `json:"type"`
	ApplicationID     string              `json:"application_id,omitempty"`
	MessageReference  *MessageReference   `json:"message_reference,omitempty"`
	ReferencedMessage *Message            `json:"referenced_message,omitempty"`
	Interaction       *MessageInteraction `json:"interaction,omitempty"`
	Thread            *Channel            `json:"thread,omitempty"`
	Components        []*Component        `json:"components,omitempty"`
}

type MessageInteraction

type MessageInteraction struct {
	ID     string          `json:"id"`
	Type   InteractionType `json:"type"`
	Name   string          `json:"name"`
	User   *User           `json:"user"`
	Member *GuildMember    `json:"member,omitempty"`
}

type MessageMention

type MessageMention struct {
	*User
	Member *GuildMember `json:"member"`
}

type MessageReference

type MessageReference struct {
	MessageID       string `json:"message_id,omitempty"`
	ChannelID       string `json:"channel_id,omitempty"`
	GuildID         string `json:"guild_id,omitempty"`
	FailIfNotExists bool   `json:"fail_if_not_exists,omitempty"`
}

type MessageType

type MessageType int
const (
	MessageTypeDefault MessageType = iota
	MessageTypeRecipientAdd
	MessageTypeRecipientRemove
	MessageTypeCall
	MessageTypeChannelNameChange
	MessageTypeChannelIconChange
	MessageTypeChannelPinnedMessage
	MessageTypeGuildMemberJoin
	MessageTypeUserPremiumGuildSubscription
	MessageTypeUserPremiumGuildSubscriptionTier1
	MessageTypeUserPremiumGuildSubscriptionTier2
	MessageTypeUserPremiumGuildSubscriptionTier3
	MessageTypeChannelFollowAdd

	MessageTypeGuildDiscoveryDisqualified
	MessageTypeGuildDiscoveryRequalified
	MessageTypeGuildDiscoveryGracePeriodInitialWarning
	MessageTypeGuildDiscoveryGracePeriodFinalWarning
	MessageTypeThreadCreated
	MessageTypeReply
	MessageTypeChatInputCommand
	MessageTypeThreadStarterMessage
	MessageTypeGuildInviteReminder
	MessageTypeContextMenuCommand
)

type Overwrite

type Overwrite struct {
	ID    string `json:"id"`
	Type  int    `json:"type"`
	Allow string `json:"allow"`
	Deny  string `json:"deny"`
}

type PremiumTier

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

type PremiumType

type PremiumType int
const (
	PremiumTypeNone PremiumType = iota
	PremiumTypeNitroClassic
	PremiumTypeNitro
)

type Presence

type Presence struct {
	Since      null.Int    `json:"since"`
	Activities []*Activity `json:"activities"`
	Status     StatusType  `json:"status"`
	AFK        bool        `json:"afk"`
}

type Reaction

type Reaction struct {
	Count int    `json:"count"`
	Me    bool   `json:"me"`
	Emoji *Emoji `json:"emoji"`
}

type ResolvedData

type ResolvedData struct {
	Users    map[string]*User        `json:"users,omitempty"`
	Members  map[string]*GuildMember `json:"members,omitempty"`
	Roles    map[string]*Role        `json:"roles,omitempty"`
	Channels map[string]*Channel     `json:"channels,omitempty"`
	Messages map[string]*Message     `json:"messages,omitempty"`
}

type Role

type Role struct {
	ID           string      `json:"id"`
	Name         string      `json:"name"`
	Color        int         `json:"color"`
	Hoist        bool        `json:"hoist"`
	Icon         null.String `json:"icon,omitempty"`
	UnicodeEmoji null.String `json:"unicode_emoji"`
	Position     int         `json:"position"`
	Permissions  string      `json:"permissions"`
	Managed      bool        `json:"managed"`
	Mentionable  bool        `json:"mentionable"`
	Tags         *RoleTag    `json:"tags,omitempty"`
}

type RoleTag

type RoleTag struct {
	BotID         string `json:"bot_id,omitempty"`
	IntegrationID string `json:"integration_id"`
}

type SelectOption

type SelectOption struct {
	Label       string `json:"label"`
	Value       string `json:"value"`
	Description string `json:"description,omitempty"`
	Emoji       *Emoji `json:"emoji,omitempty"`
	Default     bool   `json:"default,omitempty"`
}

type StatusType

type StatusType string
const (
	StatusTypeOnline    StatusType = "online"
	StatusTypeDND       StatusType = "dnd"
	StatusTypeIdle      StatusType = "idle"
	StatusTypeInvisible StatusType = "invisible"
	StatusTypeOffline   StatusType = "offline"
)

type SystemChannelFlag

type SystemChannelFlag int
const (
	SystemChannelFlagSuppressJoinNotifications          SystemChannelFlag = 1 << 0
	SystemChannelFlagSuppressPremiumSubscriptions       SystemChannelFlag = 1 << 1
	SystemChannelFlagSuppressGuildReminderNotifications SystemChannelFlag = 1 << 2
	SystemChannelFlagSuppressJoinNotificationReplies    SystemChannelFlag = 1 << 3
)

type ThreadMember

type ThreadMember struct {
	ID            string `json:"id,omitempty"`
	UserID        string `json:"user_id,omitempty"`
	JoinTimestamp Time   `json:"join_timestamp,omitempty"`
	Flags         int    `json:"flags"`
}

type ThreadMetadata

type ThreadMetadata struct {
	Archived            bool `json:"archived"`
	AutoArchiveDuration int  `json:"auto_archive_duration"`
	ArchiveTimestamp    Time `json:"archive_timestamp"`
	Locked              bool `json:"locked"`
	Invitable           bool `json:"invitable,omitempty"`
	CreateTimestamp     Time `json:"create_timestamp,omitempty"`
}

type Time

type Time struct {
	time.Time
}

func Now

func Now() Time

func TimeToTime

func TimeToTime(t time.Time) Time

func (Time) MarshalJSON

func (t Time) MarshalJSON() ([]byte, error)

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(r []byte) error

type UnavailableGuild

type UnavailableGuild struct {
	ID          string `json:"id"`
	Unavailable bool   `json:"unavailable"`
}

type User

type User struct {
	ID            string      `json:"id"`
	Username      string      `json:"username"`
	Discriminator string      `json:"discriminator"`
	Avatar        null.String `json:"avatar"`
	Bot           bool        `json:"bot,omitempty"`
	System        bool        `json:"system,omitempty"`
	MFAEnabled    bool        `json:"mfa_enabled"`
	Banner        null.String `json:"banner,omitempty"`
	AccentColor   null.Int    `json:"accent_color,omitempty"`
	Locale        string      `json:"locale,omitempty"`
	Verified      bool        `json:"verified,omitempty"`
	Email         null.String `json:"email,omitempty"`
	Flags         int         `json:"flags,omitempty"`
	PremiumType   PremiumType `json:"premium_type,omitempty"`
	PublicFlags   UserFlag    `json:"public_flags,omitempty"`
}

type UserFlag

type UserFlag int
const (
	UserFlagNone                  UserFlag = 0
	UserFlagStaff                 UserFlag = 1 << 0
	UserFlagPartner               UserFlag = 1 << 1
	UserFlagHypesquad             UserFlag = 1 << 2
	UserFlagBugHunterLevel1       UserFlag = 1 << 3
	UserFlagHypesquadOnlineHouse1 UserFlag = 1 << 6
	UserFlagHypesquadOnlineHouse2 UserFlag = 1 << 7
	UserFlagHypesquadOnlineHouse3 UserFlag = 1 << 8
	UserFlagPremiumEarlySupporter UserFlag = 1 << 9
	UserFlagTeamPseudoUser        UserFlag = 1 << 10
	UserFlagBugHunterLevel2       UserFlag = 1 << 14
	UserFlagVerifiedBot           UserFlag = 1 << 16
	UserFlagVerifiedDeveloper     UserFlag = 1 << 17
	UserFlagCertifiedModerator    UserFlag = 1 << 18
	UserFlagBotHTTPInteractions   UserFlag = 1 << 19
)

type VerificationLevel

type VerificationLevel int
const (
	VerificationLevelNone VerificationLevel = iota
	VerificationLevelLow
	VerificationLevelMedium
	VerificationLevelHigh
	VerificationLevelVeryHigh
)

type VideoQualityMode

type VideoQualityMode int
const (
	VideoQualityModeAuto VideoQualityMode = iota + 1
	VideoQualityModeFull
)

Directories

Path Synopsis
Package null implements nullable types for Discord's various APIs.
Package null implements nullable types for Discord's various APIs.

Jump to

Keyboard shortcuts

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