midjourney

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2023 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DSApplicationCommand

type DSApplicationCommand struct {
	Id                       string            `json:"id"`
	ApplicationId            string            `json:"application_id"`
	Version                  string            `json:"version"`
	DefaultPermission        bool              `json:"default_permission"`
	DefaultMemberPermissions map[string]int    `json:"default_member_permissions"`
	Type                     int64             `json:"type"`
	Nsfw                     bool              `json:"nsfw"`
	Name                     string            `json:"name"`
	Description              string            `json:"description"`
	DmPermission             bool              `json:"dm_permission"`
	Options                  []DSCommandOption `json:"options"`
}

type DSCommand

type DSCommand struct {
	Version            string               `json:"version"`
	Id                 string               `json:"id"`
	Name               string               `json:"name"`
	Type               int64                `json:"type"`
	Options            []DSOption           `json:"options"`
	ApplicationCommand DSApplicationCommand `json:"application_command"`
	Attachments        []interface{}        `json:"attachments"`
}

type DSCommandOption

type DSCommandOption struct {
	Type        int64  `json:"type"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Required    bool   `json:"required"`
}

type DSOption

type DSOption struct {
	Type  int64  `json:"type"`
	Name  string `json:"name"`
	Value string `json:"value"`
}

type MidJourney

type MidJourney struct {
	GuildID       string // DiscordServerId
	ChannelID     int64  // DiscordChannelId
	ApplicationId string // DiscordAppId
	SessionId     string // DiscordSessionId
	UserToken     string // DiscordUserToken
	BotToken      string // DiscordBotToken
	// contains filtered or unexported fields
}

func New

func New(cfg config.MidJourney, handlers ...any) *MidJourney

func (*MidJourney) GenerateImage

func (m *MidJourney) GenerateImage(prompt string) error

func (*MidJourney) MaxUpscale

func (m *MidJourney) MaxUpscale(messageId string, messageHash string) error

func (*MidJourney) Reset

func (m *MidJourney) Reset(messageId string, messageHash string) error

func (*MidJourney) Serve

func (m *MidJourney) Serve()

func (*MidJourney) Upscale

func (m *MidJourney) Upscale(index int64, messageId string, messageHash string) error

func (*MidJourney) Variate

func (m *MidJourney) Variate(index int64, messageId string, messageHash string) error

type ReqResetDiscord

type ReqResetDiscord = ReqUpscaleDiscord

type ReqTriggerDiscord

type ReqTriggerDiscord struct {
	Type          int64     `json:"type"`
	GuildId       string    `json:"guild_id"`
	ChannelId     string    `json:"channel_id"`
	ApplicationId string    `json:"application_id"`
	SessionId     string    `json:"session_id"`
	Data          DSCommand `json:"data"`
}

type ReqUpscaleDiscord

type ReqUpscaleDiscord struct {
	Type          int64       `json:"type"`
	GuildId       string      `json:"guild_id"`
	ChannelId     string      `json:"channel_id"`
	MessageFlags  int64       `json:"message_flags"`
	MessageId     string      `json:"message_id"`
	ApplicationId string      `json:"application_id"`
	SessionId     string      `json:"session_id"`
	Data          UpscaleData `json:"data"`
}

type ReqVariationDiscord

type ReqVariationDiscord = ReqUpscaleDiscord

type UpscaleData

type UpscaleData struct {
	ComponentType int64  `json:"component_type"`
	CustomId      string `json:"custom_id"`
}

Jump to

Keyboard shortcuts

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