2026-02-22 19:10:57 +00:00
|
|
|
package channels
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"context"
|
|
|
|
|
|
|
|
|
|
"github.com/sipeed/picoclaw/pkg/bus"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// MediaSender is an optional interface for channels that can send
|
|
|
|
|
// media attachments (images, files, audio, video).
|
|
|
|
|
// Manager discovers channels implementing this interface via type
|
|
|
|
|
// assertion and routes OutboundMediaMessage to them.
|
|
|
|
|
type MediaSender interface {
|
feat(channels): make Channel.Send return delivered message IDs (#2190)
* feat(channels): Channel.Send and MediaSender.SendMedia return delivered message IDs
Change Channel.Send signature from (ctx, msg) error to (ctx, msg) ([]string, error)
and MediaSender.SendMedia similarly, so callers can capture platform message IDs
for threading, reactions, and history annotation.
Adapters that return real IDs: Telegram (per-chunk MessageID), Discord (Message.ID),
Slack Send (ts), QQ (sentMsg.ID), Matrix (EventID). Slack SendMedia returns nil
because UploadFileV2 does not expose the posted message timestamp in its response.
All other adapters return nil IDs.
preSend and sendWithRetry in manager.go updated to propagate ([]string, bool).
README examples updated for both English and Chinese docs.
* style: apply golangci-lint fixes (golines)
* docs: fix Send migration guide — restore old error-only signature in before/after example
2026-03-31 03:07:32 +00:00
|
|
|
SendMedia(ctx context.Context, msg bus.OutboundMediaMessage) ([]string, error)
|
2026-02-22 19:10:57 +00:00
|
|
|
}
|