instance

package
v1.6.0-pre1.0...-908290d Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2025 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PinkBits          = "<:PinkBits:975398146152738906>"
	PinkSludgeMonster = "<:PinkSludgeMonster:1127334051422937240>"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiResponse

type ApiResponse struct {
	Success bool   `json:"success"`
	Message string `json:"message"`
}

type AutoBuyResult

type AutoBuyResult struct {
	Success bool
	Message string
}

type AutoBuyState

type AutoBuyState struct {
	// contains filtered or unexported fields
}

type Cell

type Cell struct {
	Row, Col int
}

type Client

type Client interface {
	SendMessage(op gateway.Opcode, data gateway.MessageData) error
	Close()
	AddHandler(event gateway.EventType, handler interface{}) error
	SendChatMessage(content string) error
	SendCommand(name string, options map[string]string) error
	SendSubCommand(name string, subCommandName string, options map[string]string) error
	ClickButton(message gateway.EventMessage, row int, column int) error
	ClickDmButton(message gateway.EventMessage, row int, column int) error
	ChooseSelectMenu(message gateway.EventMessage, row int, column int, values []string) error
	SubmitModal(modal gateway.EventModalCreate) error
	GetAuthorizationCode() (string, error)
}

type Instance

type Instance struct {
	User              *types.User
	Client            Client
	GuildID           string
	Cfg               config.Config
	AccountCfg        config.AccountsConfig
	LastRan           map[string]time.Time
	StopChan          chan struct{}
	State             string
	Ctx               context.Context
	IsRestarting      bool
	AutoBuyResultChan chan AutoBuyResult
	BreakUpdateTime   time.Time
	// contains filtered or unexported fields
}

func NewInstance

func NewInstance(
	user *types.User,
	client Client,
	guildID string,
	cfg config.Config,
	accountCfg config.AccountsConfig,
	state string,
	breakUpdateTime time.Time,
	ctx context.Context,
) *Instance

func (*Instance) Adventure

func (in *Instance) Adventure(message gateway.EventMessage)

func (*Instance) AdventureMessageCreate

func (in *Instance) AdventureMessageCreate(message gateway.EventMessage)

func (*Instance) AdventureMessageUpdate

func (in *Instance) AdventureMessageUpdate(message gateway.EventMessage)

func (*Instance) AutoBuyMessageCreate

func (in *Instance) AutoBuyMessageCreate(message gateway.EventMessage)

func (*Instance) AutoBuyMessageUpdate

func (in *Instance) AutoBuyMessageUpdate(message gateway.EventMessage)

func (*Instance) AutoBuyModalCreate

func (in *Instance) AutoBuyModalCreate(modal gateway.EventModalCreate)

func (*Instance) AutoUse

func (in *Instance) AutoUse(message gateway.EventMessage)

func (*Instance) BlackjackMessageCreate

func (in *Instance) BlackjackMessageCreate(message gateway.EventMessage)

func (*Instance) BlackjackMessageUpdate

func (in *Instance) BlackjackMessageUpdate(message gateway.EventMessage)

func (*Instance) Captcha

func (in *Instance) Captcha(message gateway.EventMessage) bool

func (*Instance) ChooseSelectMenu

func (in *Instance) ChooseSelectMenu(message gateway.EventMessage, row int, column int, values []string) error

func (*Instance) ClickButton

func (in *Instance) ClickButton(message gateway.EventMessage, row int, column int) error

func (*Instance) ClickDmButton

func (in *Instance) ClickDmButton(message gateway.EventMessage, row int, column int) error

func (*Instance) CommandsLoop

func (in *Instance) CommandsLoop()

func (*Instance) Crime

func (in *Instance) Crime(message gateway.EventMessage)

func (*Instance) EventsMessageCreate

func (in *Instance) EventsMessageCreate(message gateway.EventMessage)

func (*Instance) FishMessageCreate

func (in *Instance) FishMessageCreate(message gateway.EventMessage)

func (*Instance) FishMessageUpdate

func (in *Instance) FishMessageUpdate(message gateway.EventMessage)

func (*Instance) GetView

func (in *Instance) GetView() *View

func (*Instance) HandleMessageCreate

func (in *Instance) HandleMessageCreate(message gateway.EventMessage)

func (*Instance) HandleMessageUpdate

func (in *Instance) HandleMessageUpdate(message gateway.EventMessage)

func (*Instance) HandleModalCreate

func (in *Instance) HandleModalCreate(modal gateway.EventModalCreate)

func (*Instance) HighLow

func (in *Instance) HighLow(message gateway.EventMessage)

func (*Instance) IsPaused

func (in *Instance) IsPaused() bool

func (*Instance) MinigamesMessageCreate

func (in *Instance) MinigamesMessageCreate(message gateway.EventMessage)

func (*Instance) MinigamesMessageUpdate

func (in *Instance) MinigamesMessageUpdate(message gateway.EventMessage)

func (*Instance) Others

func (in *Instance) Others(message gateway.EventMessage)

func (*Instance) PauseCommands

func (in *Instance) PauseCommands(indefinite bool)

func (*Instance) PetsMessageCreate

func (in *Instance) PetsMessageCreate(message gateway.EventMessage)

func (*Instance) PetsMessageUpdate

func (in *Instance) PetsMessageUpdate(message gateway.EventMessage)

func (*Instance) PostMemesMessageCreate

func (in *Instance) PostMemesMessageCreate(message gateway.EventMessage)

func (*Instance) PostMemesMessageUpdate

func (in *Instance) PostMemesMessageUpdate(message gateway.EventMessage)

func (*Instance) ProfileMessageCreate

func (in *Instance) ProfileMessageCreate(message gateway.EventMessage)

func (*Instance) ProfileMessageUpdate

func (in *Instance) ProfileMessageUpdate(message gateway.EventMessage)

func (*Instance) SafeGetUsername

func (in *Instance) SafeGetUsername() string

func (*Instance) ScratchMessageCreate

func (in *Instance) ScratchMessageCreate(message gateway.EventMessage)

func (*Instance) ScratchMessageUpdate

func (in *Instance) ScratchMessageUpdate(message gateway.EventMessage)

func (*Instance) Search

func (in *Instance) Search(message gateway.EventMessage)

func (*Instance) SendChatMessage

func (in *Instance) SendChatMessage(content string, delay bool) error

func (*Instance) SendCommand

func (in *Instance) SendCommand(name string, options map[string]string, delay bool) error

func (*Instance) SendSubCommand

func (in *Instance) SendSubCommand(name string, subCommandName string, options map[string]string, delay bool) error

func (*Instance) Start

func (in *Instance) Start() error

func (*Instance) StartAutoBuy

func (in *Instance) StartAutoBuy(command string, subCommand string) <-chan AutoBuyResult

func (*Instance) Stop

func (in *Instance) Stop()

func (*Instance) StreamMessageCreate

func (in *Instance) StreamMessageCreate(message gateway.EventMessage)

func (*Instance) StreamMessageUpdate

func (in *Instance) StreamMessageUpdate(message gateway.EventMessage)

func (*Instance) SubmitModal

func (in *Instance) SubmitModal(modal gateway.EventModalCreate) error

func (*Instance) Trivia

func (in *Instance) Trivia(message gateway.EventMessage)

func (*Instance) UnpauseCommands

func (in *Instance) UnpauseCommands()

func (*Instance) UpdateConfig

func (in *Instance) UpdateConfig(newConfig config.Config)

func (*Instance) WorkMessageCreate

func (in *Instance) WorkMessageCreate(message gateway.EventMessage)

func (*Instance) WorkMessageUpdate

func (in *Instance) WorkMessageUpdate(message gateway.EventMessage)

type MessageHandler

type MessageHandler func(*Instance, gateway.EventMessage)

type View

type View struct {
	User            *types.User           `json:"user"`
	AccountCfg      config.AccountsConfig `json:"accountCfg"`
	State           string                `json:"state,omitempty"`
	BreakUpdateTime string                `json:"breakUpdateTime,omitempty"`
}

Jump to

Keyboard shortcuts

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