qq

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bot

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

Bot wraps a QQ bot with agent pool integration. It implements channel.Channel.

func New

func New(cfg Config, pool *agent.Pool, listFn channel.ModelListFunc, switchFn channel.ModelSwitchFunc) (*Bot, error)

New creates a QQ bot. Call Start to begin receiving events.

func (*Bot) Name

func (b *Bot) Name() string

Name returns the channel name. Implements channel.Channel.

func (*Bot) Notify

func (b *Bot) Notify(ctx context.Context, n channel.Notification) error

Notify sends a notification message. Implements channel.Channel.

func (*Bot) Start

func (b *Bot) Start(ctx context.Context) error

Start initializes the API client, registers event handlers, and starts a WebSocket connection. It blocks until ctx is cancelled.

func (*Bot) Stop

func (b *Bot) Stop()

Stop cancels the bot context.

type Config

type Config struct {
	AppID      string
	AppSecret  string
	GroupMode  string   // "mention" | "always" | "disabled"
	AllowedIDs []string // user OpenIDs allowed (empty = allow all)
}

Config holds QQ Bot settings.

Jump to

Keyboard shortcuts

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