midjourney

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: BSD-2-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ApplicationID string = "936929561302675456"
	SessionID     string = "ae00a0722b736de0a1829ad599845e59"
)

Variables

This section is empty.

Functions

func GetMessageHash

func GetMessageHash(url string) string

Types

type ApplicationCommandOption

type ApplicationCommandOption struct {
	Type                 int              `json:"type"`
	Name                 string           `json:"name"`
	Description          string           `json:"description"`
	Required             bool             `json:"required"`
	DescriptionLocalized string           `json:"description_localized"`
	NameLocalized        string           `json:"name_localized"`
	Choices              []map[string]any `json:"choices,omitempty"`
}

type Attachment

type Attachment struct {
	ID             int64  `json:"id"`
	UploadURL      string `json:"upload_url"`
	UploadFilename string `json:"upload_filename"`
}

type AttachmentsAndUploadRequest

type AttachmentsAndUploadRequest struct {
	*AttachmentsRequest
	Image []byte
}

type AttachmentsAndUploadResponse

type AttachmentsAndUploadResponse struct {
	ID               string `json:"id"`
	Filename         string `json:"filename"`
	UploadedFilename string `json:"uploaded_filename"`
}

type AttachmentsRequest

type AttachmentsRequest struct {
	ChannelID string `json:"channel_id"`
	Files     []File `json:"files"`
}

type AttachmentsResponse

type AttachmentsResponse struct {
	Attachments []Attachment
}

type BlendRequest

type BlendRequest struct {
	GuildID    string   `json:"guild_id"`
	ChannelID  string   `json:"channel_id"`
	ImageURLs  []string `json:"image_urls"`
	Dimensions string   `json:"dimensionsl"`
}

type Client

type Client struct {
	*http.Client

	Config *Config
}

func NewClient

func NewClient(cfg *Config) *Client

func (*Client) Attachments

func (c *Client) Attachments(ctx context.Context, attachmentsReq *AttachmentsRequest) (*AttachmentsResponse, error)

func (*Client) AttachmentsAndUpload

func (c *Client) AttachmentsAndUpload(ctx context.Context, attachmentsAndUploadReq *AttachmentsAndUploadRequest) (*AttachmentsAndUploadResponse, error)

func (*Client) Blend

func (c *Client) Blend(ctx context.Context, blendReq *BlendRequest) (string, error)

func (*Client) CustomZoom added in v0.0.4

func (c *Client) CustomZoom(ctx context.Context, picReaderReq *CustomZoomRequest) error

func (*Client) CustomZoomAdvanced added in v0.0.4

func (c *Client) CustomZoomAdvanced(ctx context.Context, picReaderReq *CustomZoomAdvancedRequest) error

func (*Client) Describe

func (c *Client) Describe(ctx context.Context, describeReq *DescribeRequest) (string, error)

func (*Client) HighVariation

func (c *Client) HighVariation(ctx context.Context, variationReq *HighVariationRequest) error

func (*Client) Imagine

func (c *Client) Imagine(ctx context.Context, imgReq *ImagineRequest) error

func (*Client) LowVariation

func (c *Client) LowVariation(ctx context.Context, variationReq *LowVariationRequest) error

func (*Client) Pan

func (c *Client) Pan(ctx context.Context, panReq *PanRequest) error

func (*Client) PicReadRetry

func (c *Client) PicReadRetry(ctx context.Context, picReaderReq *PicReadRetryRequest) error

func (*Client) PicReader

func (c *Client) PicReader(ctx context.Context, picReaderReq *PicReaderRequest) error

func (*Client) PicReaderAdvanced added in v0.0.4

func (c *Client) PicReaderAdvanced(ctx context.Context, picReaderReq *PicReaderAdvancedRequest) error

func (*Client) RegionVariation

func (c *Client) RegionVariation(ctx context.Context, variationReq *RegionVariationRequest) error

func (*Client) Reroll

func (c *Client) Reroll(ctx context.Context, rerollReq *RerollRequest) error

func (*Client) Setting

func (c *Client) Setting(ctx context.Context, describeReq *SettingRequest) (string, error)

func (*Client) Upscale

func (c *Client) Upscale(ctx context.Context, upscaleReq *UpscaleRequest) error

func (*Client) UpscaleCreative added in v0.0.4

func (c *Client) UpscaleCreative(ctx context.Context, upscaleReq *UpscaleCreativeRequest) error

func (*Client) UpscaleSubtle added in v0.0.4

func (c *Client) UpscaleSubtle(ctx context.Context, upscaleReq *UpscaleSubtleRequest) error

func (*Client) UpscaleXFour

func (c *Client) UpscaleXFour(ctx context.Context, upscaleReq *UpscaleXFourRequest) error

func (*Client) UpscaleXTwo

func (c *Client) UpscaleXTwo(ctx context.Context, upscaleReq *UpscaleXTwoRequest) error

func (*Client) Variation

func (c *Client) Variation(ctx context.Context, variationReq *VariationRequest) error

func (*Client) ZoomOutOneX

func (c *Client) ZoomOutOneX(ctx context.Context, ZoomReq *ZoomOutOneXRequest) error

func (*Client) ZoomOutTwoX

func (c *Client) ZoomOutTwoX(ctx context.Context, ZoomReq *ZoomOutTwoXRequest) error

type Config

type Config struct {
	UserToken string
}

type CustomZoomAdvancedRequest added in v0.0.4

type CustomZoomAdvancedRequest struct {
	MessageHash string `json:"message_hash"`
	GuildID     string `json:"guild_id"`
	ChannelID   string `json:"channel_id"`
	MessageID   string `json:"message_id"`
}

type CustomZoomRequest added in v0.0.4

type CustomZoomRequest struct {
	GuildID     string `json:"guild_id"`
	ChannelID   string `json:"channel_id"`
	Prompt      string `json:"prompt"`
	MessageID   string `json:"message_id"`
	MessageHash string `json:"message_hash"`
}

type DescribeRequest

type DescribeRequest struct {
	GuildID   string `json:"guild_id"`
	ChannelID string `json:"channel_id"`
	ImageURL  string `json:"image_url"`
	// contains filtered or unexported fields
}

type File

type File struct {
	ID       string `json:"id"`
	Filename string `json:"filename"`
	FileSize int64  `json:"file_size"`
}

type HighVariationRequest

type HighVariationRequest struct {
	Index       int32  `json:"index"`
	GuildID     string `json:"guild_id"`
	ChannelID   string `json:"channel_id"`
	MessageID   string `json:"message_id"`
	MessageHash string `json:"message_hash"`
}

type ImageFile

type ImageFile struct {
	ImageURL string `json:"image_url"`
	Image    []byte `json:"-"`
	// contains filtered or unexported fields
}

type ImageOption

type ImageOption struct {
	Type  int    `json:"type"`
	Name  string `json:"name"`
	Value any    `json:"value"`
}

type ImagineRequest

type ImagineRequest struct {
	GuildID   string `json:"guild_id"`
	ChannelID string `json:"channel_id"`
	Prompt    string `json:"prompt"`
}

type InteractionsRequest

type InteractionsRequest struct {
	Type          int            `json:"type"`
	ApplicationID string         `json:"application_id"`
	MessageFlags  *int           `json:"message_flags,omitempty"`
	MessageID     *string        `json:"message_id,omitempty"`
	GuildID       string         `json:"guild_id"`
	ChannelID     string         `json:"channel_id"`
	SessionID     string         `json:"session_id"`
	Data          map[string]any `json:"data"`
}

type LowVariationRequest

type LowVariationRequest struct {
	Index       int32  `json:"index"`
	GuildID     string `json:"guild_id"`
	ChannelID   string `json:"channel_id"`
	MessageID   string `json:"message_id"`
	MessageHash string `json:"message_hash"`
}

type PanRequest

type PanRequest struct {
	GuildID     string `json:"guild_id"`
	ChannelID   string `json:"channel_id"`
	MessageID   string `json:"message_id"`
	MessageHash string `json:"message_hash"`
	Param       string `json:"param"`
}

type PicReadRetryRequest

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

type PicReaderAdvancedRequest added in v0.0.4

type PicReaderAdvancedRequest struct {
	Index     int32  `json:"index"`
	GuildID   string `json:"guild_id"`
	ChannelID string `json:"channel_id"`
	MessageID string `json:"message_id"`
}

type PicReaderRequest

type PicReaderRequest struct {
	Index     int32  `json:"index"`
	GuildID   string `json:"guild_id"`
	ChannelID string `json:"channel_id"`
	Prompt    string `json:"prompt"`
	MessageID string `json:"message_id"`
}

type RegionVariationRequest

type RegionVariationRequest struct {
	Index       int32  `json:"index"`
	GuildID     string `json:"guild_id"`
	ChannelID   string `json:"channel_id"`
	MessageID   string `json:"message_id"`
	MessageHash string `json:"message_hash"`
}

type RerollRequest

type RerollRequest struct {
	GuildID     string `json:"guild_id"`
	ChannelID   string `json:"channel_id"`
	MessageID   string `json:"message_id"`
	MessageHash string `json:"message_hash"`
}

type SettingRequest

type SettingRequest struct {
	GuildID   string `json:"guild_id"`
	ChannelID string `json:"channel_id"`
}

type UpscaleCreativeRequest added in v0.0.4

type UpscaleCreativeRequest struct {
	Index       int32  `json:"index"`
	GuildID     string `json:"guild_id"`
	ChannelID   string `json:"channel_id"`
	MessageID   string `json:"message_id"`
	MessageHash string `json:"message_hash"`
}

type UpscaleRequest

type UpscaleRequest struct {
	Index       int32  `json:"index"`
	GuildID     string `json:"guild_id"`
	ChannelID   string `json:"channel_id"`
	MessageID   string `json:"message_id"`
	MessageHash string `json:"message_hash"`
}

type UpscaleSubtleRequest added in v0.0.4

type UpscaleSubtleRequest struct {
	Index       int32  `json:"index"`
	GuildID     string `json:"guild_id"`
	ChannelID   string `json:"channel_id"`
	MessageID   string `json:"message_id"`
	MessageHash string `json:"message_hash"`
}

type UpscaleXFourRequest

type UpscaleXFourRequest struct {
	Index       int32  `json:"index"`
	GuildID     string `json:"guild_id"`
	ChannelID   string `json:"channel_id"`
	MessageID   string `json:"message_id"`
	MessageHash string `json:"message_hash"`
}

type UpscaleXTwoRequest

type UpscaleXTwoRequest struct {
	Index       int32  `json:"index"`
	GuildID     string `json:"guild_id"`
	ChannelID   string `json:"channel_id"`
	MessageID   string `json:"message_id"`
	MessageHash string `json:"message_hash"`
}

type VariationRequest

type VariationRequest struct {
	Index       int32  `json:"index"`
	GuildID     string `json:"guild_id"`
	ChannelID   string `json:"channel_id"`
	MessageID   string `json:"message_id"`
	MessageHash string `json:"message_hash"`
}

type ZoomOutOneXRequest

type ZoomOutOneXRequest struct {
	GuildID     string `json:"guild_id"`
	ChannelID   string `json:"channel_id"`
	MessageID   string `json:"message_id"`
	MessageHash string `json:"message_hash"`
}

type ZoomOutTwoXRequest

type ZoomOutTwoXRequest struct {
	GuildID     string `json:"guild_id"`
	ChannelID   string `json:"channel_id"`
	MessageID   string `json:"message_id"`
	MessageHash string `json:"message_hash"`
}

Jump to

Keyboard shortcuts

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