dingtalk

package
v0.11.3 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter struct {
	*base.Adapter
	// contains filtered or unexported fields
}

func NewAdapter

func NewAdapter(config Config, logger *slog.Logger, opts ...base.AdapterOption) *Adapter

func (*Adapter) ChunkMessage

func (a *Adapter) ChunkMessage(content string) []string

func (*Adapter) GetAccessToken

func (a *Adapter) GetAccessToken() (string, error)

func (*Adapter) SendMessage

func (a *Adapter) SendMessage(ctx context.Context, sessionID string, msg *base.ChatMessage) error

func (*Adapter) SetSender

func (a *Adapter) SetSender(fn func(ctx context.Context, sessionID string, msg *base.ChatMessage) error)

func (*Adapter) Stop

func (a *Adapter) Stop() error

Stop stops the adapter and waits for pending webhook goroutines

type CallbackRequest

type CallbackRequest struct {
	MsgType        string `json:"msgtype"`
	ConversationID string `json:"conversationId"`
	SenderID       string `json:"senderId"`
	SenderNick     string `json:"senderNick"`
	IsAdmin        bool   `json:"isAdmin"`
	RobotCode      string `json:"robotCode"`
	Text           struct {
		Content string `json:"content"`
	} `json:"text"`
	EventType string `json:"eventType"`
}

type Config

type Config struct {
	AppID         string
	AppSecret     string
	CallbackURL   string
	CallbackToken string
	CallbackKey   string
	ServerAddr    string
	MaxMessageLen int
	SystemPrompt  string
}

Jump to

Keyboard shortcuts

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