braibottypes

package
v0.0.0-...-4b039c5 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2026 License: ISC Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BisonBotAdapter

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

BisonBotAdapter adapts *kit.Bot to the BotInterface This allows us to use *kit.Bot where BotInterface is required and provides the required SendPM, SendGC, and SendGCMessage methods with the correct signatures.

func NewBisonBotAdapter

func NewBisonBotAdapter(bot *kit.Bot) *BisonBotAdapter

func (*BisonBotAdapter) SendGC

func (a *BisonBotAdapter) SendGC(ctx context.Context, gc string, msg string) error

func (*BisonBotAdapter) SendGCMessage

func (a *BisonBotAdapter) SendGCMessage(ctx context.Context, gc string, channel string, msg string) error

func (*BisonBotAdapter) SendPM

func (a *BisonBotAdapter) SendPM(ctx context.Context, uid zkidentity.ShortID, msg string) error

type BotInterface

type BotInterface interface {
	SendPM(ctx context.Context, uid zkidentity.ShortID, msg string) error
	SendGC(ctx context.Context, gc string, msg string) error
	SendGCMessage(ctx context.Context, gc string, channel string, msg string) error
}

BotInterface defines the interface for bot operations

type Command

type Command struct {
	Name        string
	Description string
	Category    string
	Handler     CommandHandler
}

Command represents a bot command

type CommandFunc

type CommandFunc func(ctx context.Context, msgCtx MessageContext, args []string, sender *MessageSender, db DBManagerInterface) error

CommandFunc is a function type that implements CommandHandler

func (CommandFunc) Handle

func (f CommandFunc) Handle(ctx context.Context, msgCtx MessageContext, args []string, sender *MessageSender, db DBManagerInterface) error

Handle implements the CommandHandler interface for CommandFunc

type CommandHandler

type CommandHandler interface {
	Handle(ctx context.Context, msgCtx MessageContext, args []string, sender *MessageSender, db DBManagerInterface) error
}

CommandHandler defines the interface for command handlers

type DBManagerInterface

type DBManagerInterface interface {
	GetBalance(userID string) (int64, error)
	UpdateBalance(userID string, amount int64) error
	Close() error
}

DBManagerInterface defines the interface for database operations

type ExternalBilling

type ExternalBilling struct {
	ChargedDCR float64
	ChargedUSD float64
	BalanceDCR float64 // balance after the charge
}

ExternalBilling reports a charge that was already applied by an external biller (the MCP harness) before the service ran. Services with internal billing disabled include it in the status DMs instead of reporting billing as disabled.

type GCReceivedMsg

type GCReceivedMsg struct {
	Nick    string
	Uid     []byte
	GcAlias string
	Msg     struct {
		Message string
	}
}

GCReceivedMsg represents a received group chat message

type GenerationRequest

type GenerationRequest struct {
	ModelName       string
	ModelType       string
	Progress        fal.ProgressCallback
	UserNick        string
	UserID          zkidentity.ShortID
	PriceUSD        float64
	IsPM            bool   // Whether this is a private message
	GC              string // Group chat name if not PM
	ExternalBilling *ExternalBilling
}

GenerationRequest contains fields common to all generation service requests (video, image, speech).

type MessageContext

type MessageContext struct {
	// Common fields
	Nick    string // User's nickname
	Uid     []byte // User's ID
	Message string // The message content

	// Context-specific fields
	IsPM   bool               // Whether this is a private message
	Sender zkidentity.ShortID // Sender's ID (for PM)
	GC     string             // Group chat ID (for GC)
}

MessageContext represents a unified message context for both PM and group chat messages

type MessageSender

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

MessageSender provides a unified interface for sending messages in both PM and group chat contexts

func NewMessageSender

func NewMessageSender(bot BotInterface) *MessageSender

NewMessageSender creates a new MessageSender instance

func (*MessageSender) SendErrorMessage

func (s *MessageSender) SendErrorMessage(ctx context.Context, msgCtx MessageContext, err error) error

SendErrorMessage sends an error message to the user

func (*MessageSender) SendMessage

func (s *MessageSender) SendMessage(ctx context.Context, msgCtx MessageContext, message string) error

SendMessage sends a message to the user in the appropriate context

func (*MessageSender) SendSuccessMessage

func (s *MessageSender) SendSuccessMessage(ctx context.Context, msgCtx MessageContext, message string) error

SendSuccessMessage sends a success message to the user

type ReceivedPM

type ReceivedPM struct {
	Nick string
	Uid  []byte
	Msg  struct {
		Message string
	}
}

ReceivedPM represents a received private message

Jump to

Keyboard shortcuts

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