wechat

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PromptMD string

Functions

func DownloadMessageMedia

func DownloadMessageMedia(ctx context.Context, bot *libwechat.Bot, msg *wxtypes.WeixinMessage) []types.MediaFile

DownloadMessageMedia downloads all media from a WeChat message to /tmp. Errors on individual items are logged and skipped.

Types

type WeChat

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

WeChat implements channel.Channel for the WeChat iLink platform.

func New

func New(creds *types.Credentials, accountsDir string) *WeChat

New creates a WeChat backend with the given credentials.

func (*WeChat) Creds

func (w *WeChat) Creds() *types.Credentials

Creds returns the stored credentials (for persistence by caller).

func (*WeChat) Name

func (w *WeChat) Name() string

Name returns the backend identifier.

func (*WeChat) Presenter

func (w *WeChat) Presenter() channel.Presenter

Presenter returns the WeChat presenter for rendering responses.

func (*WeChat) ProbeThread

func (w *WeChat) ProbeThread(_ context.Context, _ string) error

func (*WeChat) RenameThread

func (w *WeChat) RenameThread(_ context.Context, _, _ string)

func (*WeChat) Send

func (w *WeChat) Send(ctx context.Context, msg channel.OutboundMessage) error

Send sends a message to a user on the platform.

func (*WeChat) Setup

func (w *WeChat) Setup(ctx context.Context) error

Setup performs QR code login and stores credentials internally.

func (*WeChat) ShareQR

func (w *WeChat) ShareQR(ctx context.Context) (string, error)

ShareQR fetches a bot login QR code, saves it as a PNG image, and polls for scan confirmation in the background. On success, saves credentials to the accounts directory (picked up by the file watcher).

func (*WeChat) Start

func (w *WeChat) Start(ctx context.Context, handler channel.InboundHandler) error

Start begins receiving messages. Blocks until ctx is canceled.

func (*WeChat) StartTyping

func (w *WeChat) StartTyping(ctx context.Context, userID, replyToken string) (stop func())

Jump to

Keyboard shortcuts

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