midjourney

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: BSD-2-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ApplicationID string = "936929561302675456"
	SessionID     string = "5225c9701da8be9aeac4c0222422cdbb"
)

Variables

This section is empty.

Functions

func GetMessageHash

func GetMessageHash(url string) string

Types

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 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) Describe

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

func (*Client) HighVariation added in v0.0.4

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 added in v0.0.4

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

func (*Client) Pan added in v0.0.4

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

func (*Client) PicReader added in v0.0.4

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

func (*Client) RegionVariation added in v0.0.4

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) Upscale

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

func (*Client) UpscaleXFour

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

func (*Client) UpscaleXTwo added in v0.0.4

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 added in v0.0.4

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

func (*Client) ZoomOutTwoX added in v0.0.4

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

type Config

type Config struct {
	UserToken string
}

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 added in v0.0.4

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 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 added in v0.0.4

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 added in v0.0.4

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 PicReaderRequest added in v0.0.4

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

type RegionVariationRequest added in v0.0.4

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 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 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 added in v0.0.4

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 added in v0.0.4

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 added in v0.0.4

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