discord

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2023 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RoleMentionType     AllowedMentionType = "roles"
	UserMentionType                        = "users"
	EveryoneMentionType                    = "everyone"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AllowedMentionType

type AllowedMentionType string

type AllowedMentions

type AllowedMentions struct {
	Parse       []AllowedMentionType `json:"parse"`
	Roles       []Snowflake          `json:"roles"`
	Users       []Snowflake          `json:"users"`
	RepliedUser bool                 `json:"replied_user"`
}

type Attachment

type Attachment struct {
	ID          Snowflake `json:"id"`
	Filename    string    `json:"filename"`
	Description *string   `json:"description,omitempty"`
	ContentType *string   `json:"content_type,omitempty"`
	Size        int       `json:"size"`
	URL         string    `json:"url"`
	ProxyURL    string    `json:"proxy_url"`
	Height      *int      `json:"height,omitempty"`
	Width       *int      `json:"width,omitempty"`
	Ephemeral   *bool     `json:"ephemeral,omitempty"`
}

type Embed

type Embed struct {
	Title       string         `json:"title,omitempty"`
	Type        string         `json:"type,omitempty"`
	Description string         `json:"description,omitempty"`
	URL         string         `json:"url,omitempty"`
	Timestamp   string         `json:"timestamp,omitempty"`
	Color       int            `json:"color,omitempty"`
	Footer      *EmbedFooter   `json:"footer,omitempty"`
	Image       *EmbedImage    `json:"image,omitempty"`
	Thumbnail   *EmbedImage    `json:"thumbnail,omitempty"`
	Video       *EmbedVideo    `json:"video,omitempty"`
	Provider    *EmbedProvider `json:"provider,omitempty"`
	Author      *EmbedAuthor   `json:"author,omitempty"`
	Fields      []EmbedField   `json:"fields,omitempty"`
}

type EmbedAuthor

type EmbedAuthor struct {
	Name         string `json:"name,omitempty"`
	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"`
	Height   int    `json:"height,omitempty"`
	Width    int    `json:"width,omitempty"`
}

type EmbedProvider

type EmbedProvider struct {
	Name string `json:"name,omitempty"`
	URL  string `json:"url,omitempty"`
}

type EmbedVideo

type EmbedVideo struct {
	URL      string `json:"url"`
	ProxyURL string `json:"proxy_url,omitempty"`
	Height   int    `json:"height,omitempty"`
	Width    int    `json:"width,omitempty"`
}

type Emoji

type Emoji struct {
	Id            *Snowflake  `json:"id,omitempty"`
	Name          *string     `json:"name,omitempty"`
	Roles         []Snowflake `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 Member

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

type Permissions

type Permissions uint64

func (*Permissions) MarshalJSON

func (i *Permissions) MarshalJSON() ([]byte, error)

func (*Permissions) UnmarshalJSON

func (i *Permissions) UnmarshalJSON(b []byte) error

type ResolvedData

type ResolvedData struct {
	Users   *map[string]*User   `json:"users,omitempty"`
	Members *map[string]*Member `json:"members,omitempty"`
	Roles   *map[string]*Role   `json:"roles,omitempty"`
}

type Role

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

type RoleTags

type RoleTags struct {
	BotId                 *Snowflake `json:"bot_id,omitempty"`
	IntegrationId         *Snowflake `json:"integration_id,omitempty"`
	SubscriptionListingId *Snowflake `json:"subscription_listing_id,omitempty"`
	// These fields should be set to "null" in the JSON if they are true, according to the Discord docs...
	PremiumSubscriber    bool `json:"premium_subscriber,omitempty"`
	AvailableForPurchase bool `json:"available_for_purchase,omitempty"`
	GuildConnections     bool `json:"guild_connections,omitempty"`
}

func (*RoleTags) MarshalJSON

func (tags *RoleTags) MarshalJSON() ([]byte, error)

func (*RoleTags) UnmarshalJSON

func (tags *RoleTags) UnmarshalJSON(b []byte) error

type Snowflake

type Snowflake uint64

func GetSnowflake

func GetSnowflake(id interface{}) (Snowflake, error)

func (*Snowflake) MarshalJSON

func (i *Snowflake) MarshalJSON() ([]byte, error)

func (*Snowflake) UnmarshalJSON

func (i *Snowflake) UnmarshalJSON(b []byte) error

type User

type User struct {
	Id            Snowflake `json:"id"`
	Username      string    `json:"username"`
	Discriminator string    `json:"discriminator"`
	Avatar        *string   `json:"avatar,omitempty"`
	Bot           *bool     `json:"bot,omitempty"`
	System        *bool     `json:"system,omitempty"`
	MfaEnabled    *bool     `json:"mfa_enabled,omitempty"`
	Banner        *string   `json:"banner,omitempty"`
	AccentColor   *uint32   `json:"accent_color,omitempty"`
	Locale        *string   `json:"locale,omitempty"`
	Verified      *bool     `json:"verified,omitempty"`
	Email         *string   `json:"email,omitempty"`
	Flags         *uint32   `json:"flags,omitempty"`
	PremiumType   *uint8    `json:"premium_type,omitempty"`
	PublicFlags   *uint32   `json:"public_flags,omitempty"`
}

Jump to

Keyboard shortcuts

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