midjourney

package
v0.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

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

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

func (*Client) Imagine

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

func (*Client) Upscale

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

func (*Client) Variation

func (c *Client) Variation(ctx context.Context, variationReq *VariationRequest) 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 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 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 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"`
}

Jump to

Keyboard shortcuts

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