wire

package
v0.0.0-...-9b2646f Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIResponse

type APIResponse[Data any] struct {
	Success bool   `json:"success"`
	Data    Data   `json:"data"`
	Error   *Error `json:"error,omitempty"`
}

type AssistantGenerateMessageRequestWire

type AssistantGenerateMessageRequestWire struct {
	BaseData null.String `json:"base_data"`
	Prompt   string      `json:"prompt"`
}

type AssistantGenerateMessageResponseDataWire

type AssistantGenerateMessageResponseDataWire struct {
	Data string `json:"data"`
}

type AuthExchangeRequestWire

type AuthExchangeRequestWire struct {
	Code string `json:"code"`
}

type AuthExchangeResponseDataWire

type AuthExchangeResponseDataWire struct {
	AccessToken  string `json:"access_token"`
	SessionToken string `json:"session_token"`
}

type ConsumeEntitlementRequestWire

type ConsumeEntitlementRequestWire struct {
	GuildID string `json:"guild_id"`
}

func (ConsumeEntitlementRequestWire) Validate

func (req ConsumeEntitlementRequestWire) Validate() error

type ConsumeEntitlementResponseWire

type ConsumeEntitlementResponseWire APIResponse[struct{}]

type CustomBotConfigureRequestWire

type CustomBotConfigureRequestWire struct {
	Token string `json:"token"`
}

func (CustomBotConfigureRequestWire) Validate

func (req CustomBotConfigureRequestWire) Validate() error

type CustomBotConfigureResponseWire

type CustomBotConfigureResponseWire APIResponse[CustomBotInfoWire]

type CustomBotDisableResponseDataWire

type CustomBotDisableResponseDataWire struct{}

type CustomBotGetResponseWire

type CustomBotGetResponseWire APIResponse[CustomBotInfoWire]

type CustomBotInfoWire

type CustomBotInfoWire struct {
	ID                string      `json:"id"`
	ApplicationID     string      `json:"application_id"`
	UserID            string      `json:"user_id"`
	UserName          string      `json:"user_name"`
	UserDiscriminator string      `json:"user_discriminator"`
	UserAvatar        null.String `json:"user_avatar"`

	TokenValid              bool   `json:"token_valid"`
	IsMember                bool   `json:"is_member"`
	HasPermissions          bool   `json:"has_permissions"`
	HandledFirstInteraction bool   `json:"handled_first_interaction"`
	InviteURL               string `json:"invite_url"`
	InteractionEndpointURL  string `json:"interaction_endpoint_url"`

	GatewayStatus        string      `json:"gateway_status"`
	GatewayActivityType  null.Int    `json:"gateway_activity_type"`
	GatewayActivityName  null.String `json:"gateway_activity_name"`
	GatewayActivityState null.String `json:"gateway_activity_state"`
	GatewayActivityURL   null.String `json:"gateway_activity_url"`
}

type CustomBotPresenceWire

type CustomBotPresenceWire struct {
	GatewayStatus        string `json:"gateway_status"`
	GatewayActivityType  int    `json:"gateway_activity_type,omitempty"`
	GatewayActivityName  string `json:"gateway_activity_name,omitempty"`
	GatewayActivityState string `json:"gateway_activity_state,omitempty"`
	GatewayActivityURL   string `json:"gateway_activity_url,omitempty"`
}

type CustomBotUpdatePresenceRequestWire

type CustomBotUpdatePresenceRequestWire CustomBotPresenceWire

func (CustomBotUpdatePresenceRequestWire) Validate

type CustomBotUpdatePresenceResponseWire

type CustomBotUpdatePresenceResponseWire APIResponse[CustomBotPresenceWire]

type CustomCommandCreateRequestWire

type CustomCommandCreateRequestWire struct {
	Name        string                       `json:"name"`
	Description string                       `json:"description"`
	Parameters  []CustomCommandParameterWire `json:"parameters"`
	Actions     json.RawMessage              `json:"actions"`
}

func (*CustomCommandCreateRequestWire) Normalize

func (r *CustomCommandCreateRequestWire) Normalize()

func (CustomCommandCreateRequestWire) Validate

type CustomCommandCreateResponseWire

type CustomCommandCreateResponseWire APIResponse[CustomCommandWire]

type CustomCommandDeleteResponseWire

type CustomCommandDeleteResponseWire APIResponse[struct{}]

type CustomCommandGetResponseWire

type CustomCommandGetResponseWire APIResponse[CustomCommandWire]

type CustomCommandParameterWire

type CustomCommandParameterWire struct {
	ID          int    `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Type        int    `json:"type"`
}

type CustomCommandUpdateRequestWire

type CustomCommandUpdateRequestWire struct {
	Name        string                       `json:"name"`
	Description string                       `json:"description"`
	Enabled     bool                         `json:"enabled"`
	Parameters  []CustomCommandParameterWire `json:"parameters"`
	Actions     json.RawMessage              `json:"actions"`
}

func (*CustomCommandUpdateRequestWire) Normalize

func (r *CustomCommandUpdateRequestWire) Normalize()

func (CustomCommandUpdateRequestWire) Validate

type CustomCommandUpdateResponseWire

type CustomCommandUpdateResponseWire APIResponse[CustomCommandWire]

type CustomCommandWire

type CustomCommandWire struct {
	ID          string                       `json:"id"`
	Name        string                       `json:"name"`
	Description string                       `json:"description"`
	Enabled     bool                         `json:"enabled"`
	Parameters  []CustomCommandParameterWire `json:"parameters"`
	Actions     json.RawMessage              `json:"actions"`
	CreatedAt   time.Time                    `json:"created_at"`
	UpdatedAt   time.Time                    `json:"updated_at"`
	DeployedAt  null.Time                    `json:"deployed_at"`
}

type CustomCommandsDeployResponseWire

type CustomCommandsDeployResponseWire APIResponse[struct{}]

type CustomCommandsListResponseWire

type CustomCommandsListResponseWire APIResponse[[]CustomCommandWire]

type EmbedLinkCreateRequestWire

type EmbedLinkCreateRequestWire struct {
	Url            string      `json:"url"`
	ThemeColor     null.String `json:"theme_color"`
	OgTitle        null.String `json:"og_title"`
	OgSiteName     null.String `json:"og_site_name"`
	OgDescription  null.String `json:"og_description"`
	OgImage        null.String `json:"og_image"`
	OeType         null.String `json:"oe_type"`
	OeAuthorName   null.String `json:"oe_author_name"`
	OeAuthorUrl    null.String `json:"oe_author_url"`
	OeProviderName null.String `json:"oe_provider_name"`
	OeProviderUrl  null.String `json:"oe_provider_url"`
	TwCard         null.String `json:"tw_card"`
}

func (EmbedLinkCreateRequestWire) Validate

func (req EmbedLinkCreateRequestWire) Validate() error

type EmbedLinkCreateResponseDataWire

type EmbedLinkCreateResponseDataWire struct {
	ID  string `json:"id"`
	URL string `json:"url"`
}

type EmbedLinkOEmbedResponseWire

type EmbedLinkOEmbedResponseWire struct {
	Type         string `json:"type,omitempty"`
	Title        string `json:"title,omitempty"`
	AuthorName   string `json:"author_name,omitempty"`
	AuthorUrl    string `json:"author_url,omitempty"`
	ProviderName string `json:"provider_name,omitempty"`
	ProviderUrl  string `json:"provider_url,omitempty"`
}

type Error

type Error struct {
	Status  int         `json:"-"`
	Code    string      `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
}

func (*Error) Error

func (e *Error) Error() string

func (Error) MarshalJSON

func (e Error) MarshalJSON() ([]byte, error)

type GetGuildBrandingResponseWire

type GetGuildBrandingResponseWire APIResponse[GuildBrandingWire]

type GetGuildResponseWire

type GetGuildResponseWire APIResponse[GuildWire]

type GetImageResponseWire

type GetImageResponseWire APIResponse[ImageWire]

type GetPremiumPlanFeaturesResponseDataWire

type GetPremiumPlanFeaturesResponseDataWire struct {
	MaxSavedMessages          int  `json:"max_saved_messages"`
	MaxActionsPerComponent    int  `json:"max_actions_per_component"`
	AdvancedActionTypes       bool `json:"advanced_action_types"`
	AIAssistant               bool `json:"ai_assistant"`
	CustomBot                 bool `json:"custom_bot"`
	MaxCustomCommands         int  `json:"max_custom_commands"`
	IsPremium                 bool `json:"is_premium"`
	MaxImageUploadSize        int  `json:"max_image_upload_size"`
	MaxScheduledMessages      int  `json:"max_scheduled_messages"`
	PeriodicScheduledMessages bool `json:"periodic_scheduled_messages"`
	MaxTemplateOps            int  `json:"max_template_ops"`
	MaxKVKeys                 int  `json:"max_kv_keys"`
}

type GuildBrandingWire

type GuildBrandingWire struct {
	DefaultUsername  null.String `json:"default_username"`
	DefaultAvatarURL null.String `json:"default_avatar_url"`
}

type GuildChannelWire

type GuildChannelWire struct {
	ID       string      `json:"id"`
	Name     string      `json:"name"`
	Position int         `json:"position"`
	ParentID null.String `json:"parent_id"`
	Type     int         `json:"type"`

	UserAccess      bool   `json:"user_access"`
	UserPermissions string `json:"user_permissions"`
	BotAccess       bool   `json:"bot_access"`
	BotPermissions  string `json:"bot_permissions"`
}

type GuildEmojiWire

type GuildEmojiWire struct {
	ID        string `json:"id"`
	Name      string `json:"name"`
	Available bool   `json:"available"`
	Animated  bool   `json:"animated"`
	Managed   bool   `json:"managed"`
}

type GuildRoleWire

type GuildRoleWire struct {
	ID       string `json:"id"`
	Name     string `json:"name"`
	Managed  bool   `json:"managed"`
	Color    int    `json:"color"`
	Position int    `json:"position"`
}

type GuildStickerWire

type GuildStickerWire struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Available   bool   `json:"available"`
	FormantType int    `json:"formant_type"`
}

type GuildWire

type GuildWire struct {
	ID   string      `json:"id"`
	Name string      `json:"name"`
	Icon null.String `json:"icon"`

	HasChannelWithUserAccess bool `json:"has_channel_with_user_access"`
	HasChannelWithBotAccess  bool `json:"has_channel_with_bot_access"`
}

type ImageWire

type ImageWire struct {
	ID       string      `json:"id"`
	UserID   string      `json:"user_id"`
	GuildID  null.String `json:"guild_id"`
	FileName string      `json:"file_name"`
	FileSize int32       `json:"file_size"`
	CDNURL   string      `json:"cdn_url"`
}

type ListChannelsResponseWire

type ListChannelsResponseWire APIResponse[[]GuildChannelWire]

type ListEmojisResponseWire

type ListEmojisResponseWire APIResponse[[]GuildEmojiWire]

type ListGuildsResponseWire

type ListGuildsResponseWire APIResponse[[]GuildWire]

type ListPremiumEntitlementsResponseDataWire

type ListPremiumEntitlementsResponseDataWire struct {
	Entitlements []PremiumEntitlementWire `json:"entitlements"`
}

type ListRolesResponseWire

type ListRolesResponseWire APIResponse[[]GuildRoleWire]

type ListStickersResponseWire

type ListStickersResponseWire APIResponse[[]GuildStickerWire]

type MessageAttachmentWire

type MessageAttachmentWire struct {
	Name        string      `json:"name"`
	Description null.String `json:"description"`
	DataURL     string      `json:"data_url"`
	Size        int         `json:"size"`
}

type MessageRestoreFromChannelRequestWire

type MessageRestoreFromChannelRequestWire struct {
	GuildID   string `json:"guild_id"`
	ChannelID string `json:"channel_id"`
	MessageID string `json:"message_id"`
}

func (MessageRestoreFromChannelRequestWire) Validate

type MessageRestoreFromWebhookRequestWire

type MessageRestoreFromWebhookRequestWire struct {
	WebhookID    string      `json:"webhook_id"`
	WebhookToken string      `json:"webhook_token"`
	ThreadID     null.String `json:"thread_id"`
	MessageID    string      `json:"message_id"`
}

func (MessageRestoreFromWebhookRequestWire) Validate

type MessageRestoreResponseDataWire

type MessageRestoreResponseDataWire struct {
	Data        json.RawMessage          `json:"data"`
	Attachments []*MessageAttachmentWire `json:"attachments"`
}

type MessageSendResponseDataWire

type MessageSendResponseDataWire struct {
	MessageID string `json:"message_id"`
	ChannelID string `json:"channel_id"`
}

type MessageSendToChannelRequestWire

type MessageSendToChannelRequestWire struct {
	GuildID     string                   `json:"guild_id"`
	ChannelID   string                   `json:"channel_id"`
	ThreadName  null.String              `json:"thread_name"`
	MessageID   null.String              `json:"message_id"`
	Data        json.RawMessage          `json:"data"`
	Attachments []*MessageAttachmentWire `json:"attachments"`
}

func (MessageSendToChannelRequestWire) Validate

func (req MessageSendToChannelRequestWire) Validate() error

type MessageSendToWebhookRequestWire

type MessageSendToWebhookRequestWire struct {
	WebhookType  string                   `json:"webhook_type"`
	WebhookID    string                   `json:"webhook_id"`
	WebhookToken string                   `json:"webhook_token"`
	ThreadID     null.String              `json:"thread_id"`
	MessageID    null.String              `json:"message_id"`
	Data         json.RawMessage          `json:"data"`
	Attachments  []*MessageAttachmentWire `json:"attachments"`
}

func (MessageSendToWebhookRequestWire) Validate

func (req MessageSendToWebhookRequestWire) Validate() error

type PremiumEntitlementWire

type PremiumEntitlementWire struct {
	ID              string      `json:"id"`
	SkuID           string      `json:"sku_id"`
	UserID          null.String `json:"user_id"`
	GuildID         null.String `json:"guild_id"`
	UpdatedAt       time.Time   `json:"updated_at"`
	Deleted         bool        `json:"deleted"`
	StartsAt        null.Time   `json:"starts_at"`
	EndsAt          null.Time   `json:"ends_at"`
	Consumable      bool        `json:"consumable"`
	Consumed        bool        `json:"consumed"`
	ConsumedGuildID null.String `json:"consumed_guild_id"`
}

type SavedMessageCreateRequestWire

type SavedMessageCreateRequestWire struct {
	Name        string          `json:"name"`
	Description null.String     `json:"description"`
	Data        json.RawMessage `json:"data"`
}

func (SavedMessageCreateRequestWire) Validate

func (req SavedMessageCreateRequestWire) Validate() error

type SavedMessageCreateResponseWire

type SavedMessageCreateResponseWire APIResponse[SavedMessageWire]

type SavedMessageDeleteResponseWire

type SavedMessageDeleteResponseWire APIResponse[struct{}]

type SavedMessageGetResponseWire

type SavedMessageGetResponseWire APIResponse[SavedMessageWire]

type SavedMessageImportDataWire

type SavedMessageImportDataWire struct {
	Name        string          `json:"name"`
	Description null.String     `json:"description"`
	Data        json.RawMessage `json:"data"`
}

type SavedMessageListResponseWire

type SavedMessageListResponseWire APIResponse[[]SavedMessageWire]

type SavedMessageUpdateRequestWire

type SavedMessageUpdateRequestWire struct {
	Name        string          `json:"name"`
	Description null.String     `json:"description"`
	Data        json.RawMessage `json:"data"`
}

func (SavedMessageUpdateRequestWire) Validate

func (req SavedMessageUpdateRequestWire) Validate() error

type SavedMessageUpdateResponseWire

type SavedMessageUpdateResponseWire APIResponse[SavedMessageWire]

type SavedMessageWire

type SavedMessageWire struct {
	ID          string          `json:"id"`
	CreatorID   string          `json:"owner_id"`
	GuildID     null.String     `json:"guild_id"`
	UpdatedAt   time.Time       `json:"updated_at"`
	Name        string          `json:"name"`
	Description null.String     `json:"description"`
	Data        json.RawMessage `json:"data"`
}

type SavedMessagesImportRequestWire

type SavedMessagesImportRequestWire struct {
	Messages []SavedMessageImportDataWire `json:"messages"`
}

func (SavedMessagesImportRequestWire) Validate

func (req SavedMessagesImportRequestWire) Validate() error

type SavedMessagesImportResponseWire

type SavedMessagesImportResponseWire APIResponse[[]SavedMessageWire]

type ScheduledMessageCreateRequestWire

type ScheduledMessageCreateRequestWire struct {
	ChannelID      string      `json:"channel_id"`
	MessageID      null.String `json:"message_id"`
	ThreadName     null.String `json:"thread_name"`
	SavedMessageID string      `json:"saved_message_id"`
	Name           string      `json:"name"`
	Description    null.String `json:"description"`
	CronExpression null.String `json:"cron_expression"`
	CronTimezone   null.String `json:"cron_timezone"`
	StartAt        time.Time   `json:"start_at"`
	EndAt          null.Time   `json:"end_at"`
	OnlyOnce       bool        `json:"only_once"`
	Enabled        bool        `json:"enabled"`
}

func (ScheduledMessageCreateRequestWire) Validate

type ScheduledMessageCreateResponseWire

type ScheduledMessageCreateResponseWire APIResponse[ScheduledMessageWire]

type ScheduledMessageDeleteResponseWire

type ScheduledMessageDeleteResponseWire APIResponse[struct{}]

type ScheduledMessageGetResponseWire

type ScheduledMessageGetResponseWire APIResponse[ScheduledMessageWire]

type ScheduledMessageListResponseWire

type ScheduledMessageListResponseWire APIResponse[[]ScheduledMessageWire]

type ScheduledMessageUpdateRequestWire

type ScheduledMessageUpdateRequestWire struct {
	ChannelID      string      `json:"channel_id"`
	MessageID      null.String `json:"message_id"`
	ThreadName     null.String `json:"thread_name"`
	SavedMessageID string      `json:"saved_message_id"`
	Name           string      `json:"name"`
	Description    null.String `json:"description"`
	CronExpression null.String `json:"cron_expression"`
	CronTimezone   null.String `json:"cron_timezone"`
	StartAt        time.Time   `json:"start_at"`
	EndAt          null.Time   `json:"end_at"`
	OnlyOnce       bool        `json:"only_once"`
	Enabled        bool        `json:"enabled"`
}

func (ScheduledMessageUpdateRequestWire) Validate

type ScheduledMessageUpdateResponseWire

type ScheduledMessageUpdateResponseWire APIResponse[ScheduledMessageWire]

type ScheduledMessageWire

type ScheduledMessageWire struct {
	ID             string      `json:"id"`
	CreatorID      string      `json:"creator_id"`
	GuildID        string      `json:"guild_id"`
	ChannelID      string      `json:"channel_id"`
	MessageID      null.String `json:"message_id"`
	ThreadName     null.String `json:"thread_name"`
	SavedMessageID string      `json:"saved_message_id"`
	Name           string      `json:"name"`
	Description    null.String `json:"description"`
	CronExpression null.String `json:"cron_expression"`
	CronTimezone   null.String `json:"cron_timezone"`
	StartAt        time.Time   `json:"start_at"`
	EndAt          null.Time   `json:"end_at"`
	NextAt         time.Time   `json:"next_at"`
	OnlyOnce       bool        `json:"only_once"`
	Enabled        bool        `json:"enabled"`
	CreatedAt      time.Time   `json:"created_at"`
	UpdatedAt      time.Time   `json:"updated_at"`
}

type SharedMessageCreateRequestWire

type SharedMessageCreateRequestWire struct {
	Data json.RawMessage `json:"data"`
}

func (SharedMessageCreateRequestWire) Validate

func (req SharedMessageCreateRequestWire) Validate() error

type SharedMessageCreateResponseWire

type SharedMessageCreateResponseWire APIResponse[SharedMessageWire]

type SharedMessageGetResponseWire

type SharedMessageGetResponseWire APIResponse[SharedMessageWire]

type SharedMessageWire

type SharedMessageWire struct {
	ID        string          `json:"id"`
	CreatedAt time.Time       `json:"created_at"`
	ExpiresAt time.Time       `json:"expires_at"`
	Data      json.RawMessage `json:"data"`
	URL       string          `json:"url"`
}

type UploadImageResponseWire

type UploadImageResponseWire APIResponse[ImageWire]

type UserResponseWire

type UserResponseWire APIResponse[UserWire]

type UserWire

type UserWire struct {
	ID            string      `json:"id"`
	Name          string      `json:"name"`
	Discriminator string      `json:"discriminator"`
	Avatar        null.String `json:"avatar"`
	IsTester      bool        `json:"is_tester"`
}

Jump to

Keyboard shortcuts

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