qq

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PluginID    = "channel/qq"
	RuntimeName = "bot"
)

Variables

This section is empty.

Functions

func DecodeConfig

func DecodeConfig(raw map[string]any) (pkgchannel.QQConfig, error)

func NewQQManagedRuntime

func NewQQManagedRuntime(deps QQRuntimeDeps) pkgplugins.Runtime

func RedactConfig

func RedactConfig(raw map[string]any) map[string]any

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, handler channel.Handler) (*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) Platform added in v0.10.0

func (b *Bot) Platform() string

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 {
	InstanceID string
	AppID      string
	AppSecret  string
	GroupMode  string // "mention" | "always" | "disabled"
}

Config holds QQ Bot settings.

type QQRuntimeDeps

type QQRuntimeDeps struct {
	Parent        context.Context
	Handler       pkgchannel.Handler
	Notifications pkgplugins.ChannelRegistry
	Log           *slog.Logger
	Now           func() time.Time
	NewChannel    func(pkgchannel.QQConfig, pkgchannel.Handler) (pkgchannel.Channel, error)
}

Jump to

Keyboard shortcuts

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