2026-02-20 15:25:44 +00:00
|
|
|
//go:build !amd64 && !arm64 && !riscv64 && !mips64 && !ppc64
|
|
|
|
|
|
|
|
|
|
package feishu
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"context"
|
|
|
|
|
"errors"
|
|
|
|
|
|
|
|
|
|
"github.com/sipeed/picoclaw/pkg/bus"
|
|
|
|
|
"github.com/sipeed/picoclaw/pkg/channels"
|
|
|
|
|
"github.com/sipeed/picoclaw/pkg/config"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// FeishuChannel is a stub implementation for 32-bit architectures
|
|
|
|
|
type FeishuChannel struct {
|
|
|
|
|
*channels.BaseChannel
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-02 17:27:39 +00:00
|
|
|
var errUnsupported = errors.New("feishu channel is not supported on 32-bit architectures")
|
|
|
|
|
|
2026-02-20 15:25:44 +00:00
|
|
|
// NewFeishuChannel returns an error on 32-bit architectures where the Feishu SDK is not supported
|
2026-04-13 16:00:13 +00:00
|
|
|
func NewFeishuChannel(bc *config.Channel, cfg *config.FeishuSettings, bus *bus.MessageBus) (*FeishuChannel, error) {
|
2026-02-22 13:57:12 +00:00
|
|
|
return nil, errors.New(
|
|
|
|
|
"feishu channel is not supported on 32-bit architectures (armv7l, 386, etc.). Please use a 64-bit system or disable feishu in your config",
|
|
|
|
|
)
|
2026-02-20 15:25:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Start is a stub method to satisfy the Channel interface
|
|
|
|
|
func (c *FeishuChannel) Start(ctx context.Context) error {
|
2026-03-02 17:27:39 +00:00
|
|
|
return errUnsupported
|
2026-02-20 15:25:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Stop is a stub method to satisfy the Channel interface
|
|
|
|
|
func (c *FeishuChannel) Stop(ctx context.Context) error {
|
2026-03-02 17:27:39 +00:00
|
|
|
return errUnsupported
|
2026-02-20 15:25:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Send is a stub method to satisfy the Channel 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
|
|
|
func (c *FeishuChannel) Send(ctx context.Context, msg bus.OutboundMessage) ([]string, error) {
|
|
|
|
|
return nil, errUnsupported
|
2026-02-20 15:25:44 +00:00
|
|
|
}
|
feat(feishu): enhance channel with markdown cards, media, mentions, and editing
Upgrade the Feishu channel from basic text-only to full feature parity with
Telegram/Discord: interactive card messages with markdown rendering, message
editing (MessageEditor), placeholder messages (PlaceholderCapable), emoji
reactions (ReactionCapable), and inbound/outbound media support (MediaSender).
Also add @mention detection with lazy bot open_id discovery, group trigger
filtering with mention awareness, and multi-type inbound message parsing
(text, post, image, file, audio, video).
2026-03-02 16:49:11 +00:00
|
|
|
|
|
|
|
|
// EditMessage is a stub method to satisfy MessageEditor
|
|
|
|
|
func (c *FeishuChannel) EditMessage(ctx context.Context, chatID, messageID, content string) error {
|
2026-03-02 17:27:39 +00:00
|
|
|
return errUnsupported
|
feat(feishu): enhance channel with markdown cards, media, mentions, and editing
Upgrade the Feishu channel from basic text-only to full feature parity with
Telegram/Discord: interactive card messages with markdown rendering, message
editing (MessageEditor), placeholder messages (PlaceholderCapable), emoji
reactions (ReactionCapable), and inbound/outbound media support (MediaSender).
Also add @mention detection with lazy bot open_id discovery, group trigger
filtering with mention awareness, and multi-type inbound message parsing
(text, post, image, file, audio, video).
2026-03-02 16:49:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// SendPlaceholder is a stub method to satisfy PlaceholderCapable
|
|
|
|
|
func (c *FeishuChannel) SendPlaceholder(ctx context.Context, chatID string) (string, error) {
|
2026-03-02 17:27:39 +00:00
|
|
|
return "", errUnsupported
|
feat(feishu): enhance channel with markdown cards, media, mentions, and editing
Upgrade the Feishu channel from basic text-only to full feature parity with
Telegram/Discord: interactive card messages with markdown rendering, message
editing (MessageEditor), placeholder messages (PlaceholderCapable), emoji
reactions (ReactionCapable), and inbound/outbound media support (MediaSender).
Also add @mention detection with lazy bot open_id discovery, group trigger
filtering with mention awareness, and multi-type inbound message parsing
(text, post, image, file, audio, video).
2026-03-02 16:49:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ReactToMessage is a stub method to satisfy ReactionCapable
|
|
|
|
|
func (c *FeishuChannel) ReactToMessage(ctx context.Context, chatID, messageID string) (func(), error) {
|
2026-03-02 17:27:39 +00:00
|
|
|
return func() {}, errUnsupported
|
feat(feishu): enhance channel with markdown cards, media, mentions, and editing
Upgrade the Feishu channel from basic text-only to full feature parity with
Telegram/Discord: interactive card messages with markdown rendering, message
editing (MessageEditor), placeholder messages (PlaceholderCapable), emoji
reactions (ReactionCapable), and inbound/outbound media support (MediaSender).
Also add @mention detection with lazy bot open_id discovery, group trigger
filtering with mention awareness, and multi-type inbound message parsing
(text, post, image, file, audio, video).
2026-03-02 16:49:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// SendMedia is a stub method to satisfy MediaSender
|
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
|
|
|
func (c *FeishuChannel) SendMedia(ctx context.Context, msg bus.OutboundMediaMessage) ([]string, error) {
|
|
|
|
|
return nil, errUnsupported
|
feat(feishu): enhance channel with markdown cards, media, mentions, and editing
Upgrade the Feishu channel from basic text-only to full feature parity with
Telegram/Discord: interactive card messages with markdown rendering, message
editing (MessageEditor), placeholder messages (PlaceholderCapable), emoji
reactions (ReactionCapable), and inbound/outbound media support (MediaSender).
Also add @mention detection with lazy bot open_id discovery, group trigger
filtering with mention awareness, and multi-type inbound message parsing
(text, post, image, file, audio, video).
2026-03-02 16:49:11 +00:00
|
|
|
}
|