feishu

package
v0.5.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: 24 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 Feishu bot with agent pool integration.

func New

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

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

func (*Bot) Name

func (b *Bot) Name() string

Name returns the backend name. Implements channel.Backend.

func (*Bot) Notify

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

Notify sends a notification message. Implements channel.Backend. Supports both chat IDs (oc_ prefix) and user open IDs (ou_ prefix).

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   // app ID
	AppSecret         string   // app secret
	EncryptKey        string   // event encrypt key (from Feishu developer console)
	VerificationToken string   // event verification token (from Feishu developer console)
	NotifyChat        string   // default chat ID for proactive notifications
	GroupMode         string   // "mention" | "always" | "disabled"
	AllowedIDs        []string // user open_ids allowed (empty = allow all)
}

Config holds Feishu bot settings.

type ModelListFunc

type ModelListFunc = channel.ModelListFunc

ModelListFunc re-exports channel.ModelListFunc for use by callers.

type ModelOption

type ModelOption = channel.ModelOption

ModelOption re-exports channel.ModelOption for use by callers.

type ModelSwitchFunc

type ModelSwitchFunc = channel.ModelSwitchFunc

ModelSwitchFunc re-exports channel.ModelSwitchFunc for use by callers.

Jump to

Keyboard shortcuts

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