kitaipu

package module
v0.0.0-...-cda3272 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2022 License: MIT Imports: 4 Imported by: 2

README

kitaipu

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionRow

type ActionRow struct {
	Type       ComponentType `json:"type"`
	Components []Component   `json:"components"`
}

type AllowedMentions

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

type ButtonComponent

type ButtonComponent struct {
	Type     ComponentType  `json:"type"`
	Style    ComponentStyle `json:"style"`
	Label    string         `json:"label"`
	Emoji    PartialEmoji   `json:"emoji"`
	CustomID string         `json:"custom_id"`
	URL      string         `json:"url"`
	Disabled bool           `json:"disabled"`
}

type CallbackType

type CallbackType int
const (
	CallbackPong                                 CallbackType = 1
	CallbackChannelMessageWithSource             CallbackType = 4
	CallbackDeferredChannelMessageWithSource     CallbackType = 5
	CallbackDeferredUpdateMessage                CallbackType = 6
	CallbackUpdateMessage                        CallbackType = 7
	CallbackApplicationCommandAutocompleteResult CallbackType = 8
	CallbackModeal                               CallbackType = 9
)

type Color

type Color int

func (Color) FromRGB

func (c Color) FromRGB(r, g, b int) Color

func (Color) ToRGB

func (c Color) ToRGB() (r, g, b int)

type Command

type Command struct {
	ApplicationID string          `json:"application_id"`
	ChannelID     string          `json:"channel_id"`
	Data          CommandData     `json:"data"`
	GuildID       string          `json:"guild_id"`
	GuildLocale   string          `json:"guild_locale"`
	ID            string          `json:"id"`
	Locale        string          `json:"locale"`
	Member        Member          `json:"member"`
	Token         string          `json:"token"`
	Type          InteractionType `json:"type"`
	Version       int             `json:"version"`
}

type CommandData

type CommandData struct {
	ID       string      `json:"id"`
	Name     string      `json:"name"`
	Options  Options     `json:"options"`
	Resolved Resolved    `json:"resolved"`
	Type     CommandType `json:"type"`
}

type CommandType

type CommandType int
const (
	CmdChatInput CommandType = 1
	CmdUser      CommandType = 2
	CmdMessage   CommandType = 3
)

type Component

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

type ComponentStyle

type ComponentStyle int
const (
	ComponentStylePrimary   ComponentStyle = 1
	ComponentStyleSecondary ComponentStyle = 2
	ComponentStyleSuccess   ComponentStyle = 3
	ComponentStyleDanger    ComponentStyle = 4
	ComponentStyleLink      ComponentStyle = 5
)

Button styles

const (
	ComponentStyleShort     ComponentStyle = 1
	ComponentStyleParagraph ComponentStyle = 2
)

type ComponentType

type ComponentType int
const (
	ComponentActionRow  ComponentType = 1
	ComponentButton     ComponentType = 2
	ComponentSelectMenu ComponentType = 3
	ComponentTextInput  ComponentType = 4
)

type Embed

type Embed struct {
	Title       string        `json:"title,omitempty"`
	Description string        `json:"description,omitempty"`
	URL         string        `json:"url,omitempty"`
	Timestamp   time.Time     `json:"timestamp,omitempty"`
	Color       Color         `json:"color,omitempty"`
	Footer      EmbedFooter   `json:"footer,omitempty"`
	Image       EmbedVisual   `json:"image,omitempty"`
	Thumbnail   EmbedVisual   `json:"thumbnail,omitempty"`
	Video       EmbedVisual   `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"`
	URL          string `json:"url"`
	IconURL      string `json:"icon_url"`
	ProxyIconURL string `json:"proxy_icon_url"`
}

type EmbedField

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

type EmbedFooter

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

type EmbedProvider

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

type EmbedVisual

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

type InteractionResponse

type InteractionResponse struct {
	TTS             bool                `json:"tts,omitempty"`
	Content         string              `json:"content,omitempty"`
	Embeds          []Embed             `json:"embeds,omitempty"`
	AllowedMentions *AllowedMentions    `json:"allowed_mentions,omitempty"`
	Flags           MessageFlags        `json:"flags,omitempty"`
	Components      []Component         `json:"components,omitempty"`
	Attachments     []PartialAttachment `json:"attachments,omitempty"`
}

func (InteractionResponse) Prepare

func (r InteractionResponse) Prepare() (responseType string, b []byte, err error)

type InteractionType

type InteractionType int
const (
	InteractionPing                           InteractionType = 1
	InteractionApplicationCommand             InteractionType = 2
	InteractionMessageComponent               InteractionType = 3
	InteractionApplicationCommandAutocomplete InteractionType = 4
	InteractionModalSubmit                    InteractionType = 5
)

type Member

type Member struct {
	Avatar      string     `json:"avatar"`
	JoinedAt    time.Time  `json:"joined_at"`
	Nick        string     `json:"nick"`
	Permissions Permission `json:"permissions"`
	Roles       []string   `json:"roles"`
	User        User       `json:"user"`
	Pending     bool       `json:"pending"`
	IsPending   bool       `json:"is_pending"`
	Deaf        bool       `json:"deaf"`
	Mute        bool       `json:"mute"`
}

type MessageFlags

type MessageFlags int
const (
	MessageCrossposted MessageFlags = 1 << iota
	MessageIsCrosspost
	MessageSuppressEmbeds
	MessageSourceMessageDeleted
	MessageUrgent
	MessageHasThread
	MessageEphemeral
	MessageLoading
	MessageFailedToMentionSomeRolesInThread
)

func (MessageFlags) Add

func (f MessageFlags) Add(messageFlags MessageFlags) MessageFlags

func (MessageFlags) Has

func (f MessageFlags) Has(messageFlags MessageFlags) bool

func (MessageFlags) Remove

func (f MessageFlags) Remove(messageFlags MessageFlags) MessageFlags

type Option

type Option struct {
	Name    string     `json:"name"`
	Type    OptionType `json:"type"`
	Options Options    `json:"options"`
	Value   string     `json:"value"`
}

type OptionType

type OptionType int
const (
	OptSubCommand      OptionType = 1
	OptSubCommandGroup OptionType = 2
	OptString          OptionType = 3
	OptInt             OptionType = 4
	OptBool            OptionType = 5
	OptUser            OptionType = 6
	OptChannel         OptionType = 7
	OptRole            OptionType = 8
	OptMentionable     OptionType = 9
	OptNumber          OptionType = 10
	OptAttachment      OptionType = 11
)

type Options

type Options []Option

func (Options) Get

func (opts Options) Get(name string) (o Option, ok bool)

type PartialAttachment

type PartialAttachment struct {
	ID          string `json:"id"`
	FileName    string `json:"filename"`
	Description string `json:"description"`
}

type PartialEmoji

type PartialEmoji struct {
	Name     string `json:"name"`
	ID       string `json:"id"`
	Animated bool   `json:"animated"`
}

type Permission

type Permission int64
const (
	PermCreateInstantInvite Permission = 1 << iota
	PermKickMembers
	PermBanMembers
	PermAdministrator
	PermManageChannels
	PermManageGuild
	PermAddReactions
	PermViewAuditLog
	PermPrioritySpeaker
	PermPermStream
	PermViewChannel
	PermSendMessages
	PermSendTTSMessages
	PermManageMessages
	PermEmbedLinks
	PermAttachFiles
	PermReadMessageHistory
	PermMentionEveryone
	PermUseExternalEmojis
	PermViewGuildInsights
	PermConnect
	PermSpeak
	PermMuteMembers
	PermDeafenMembers
	PermMoveMembers
	PermUseVAD
	PermChangeNickname
	PermManageNicknames
	PermManageRoles
	PermManageWebhooks
	PermManageEmojisAndStickers
	PermUseApplicationCommands
	PermRequestToSpeak
	PermManageEvents
	PermManageThreads
	PermCreatePublicThreads
	PermCreatePrivateThreads
	PermUseExternalStickers
	PermSendMessagesInThreads
	PermStartEmbeddedActivities
	PermModerateMembers
)

func (Permission) Add

func (p Permission) Add(permission Permission) Permission

func (Permission) Has

func (p Permission) Has(permission Permission) bool

func (Permission) MarshalJSON

func (p Permission) MarshalJSON() ([]byte, error)

func (Permission) Remove

func (p Permission) Remove(permission Permission) Permission

func (*Permission) UnmarshalJSON

func (p *Permission) UnmarshalJSON(b []byte) (err error)

type Resolved

type Resolved struct {
	Members map[string]ResolvedMember `json:"members"`
	Users   map[string]User           `json:"users"`
}

type ResolvedMember

type ResolvedMember map[string]struct {
	Avatar      string     `json:"avatar"`
	JoinedAt    time.Time  `json:"joined_at"`
	Nick        string     `json:"nick"`
	Permissions Permission `json:"permissions"`
	Roles       []string   `json:"roles"`
	Pending     bool       `json:"pending"`
	IsPending   bool       `json:"is_pending"`
}

type SelectComponent

type SelectComponent struct {
	Type        ComponentType   `json:"type"`
	CustomID    string          `json:"custom_id"`
	Options     []SelectOptions `json:"options"`
	Placeholder string          `json:"placeholder"`
	MinValues   int             `json:"min_values"`
	MaxValues   int             `json:"max_values"`
	Disabled    bool            `json:"disabled"`
}

type SelectOptions

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

type TextInputComponent

type TextInputComponent struct {
	Type        ComponentType  `json:"type"`
	CustomID    string         `json:"custom_id"`
	Style       ComponentStyle `json:"style"`
	Label       string         `json:"label"`
	MinLength   int            `json:"min_length"`
	MaxLength   int            `json:"max_length"`
	Required    bool           `json:"required"`
	Value       string         `json:"value"`
	Placeholder string         `json:"placeholder"`
}

type User

type User struct {
	ID            string `json:"id"`
	Username      string `json:"username"`
	Discriminator string `json:"discriminator"`
	Avatar        string `json:"avatar"`
}

Jump to

Keyboard shortcuts

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