//go:build !amd64 && !arm64 && !riscv64 && !mips64 && !ppc64

package feishu

import (
	"context"
	"errors"

	"github.com/dapicom-ai/omnipus/pkg/bus"
	"github.com/dapicom-ai/omnipus/pkg/channels"
	"github.com/dapicom-ai/omnipus/pkg/config"
	"github.com/dapicom-ai/omnipus/pkg/credentials"
)

// FeishuChannel is a stub implementation for 32-bit architectures
type FeishuChannel struct {
	*channels.BaseChannel
}

var errUnsupported = errors.New("feishu channel is not supported on 32-bit architectures")

// NewFeishuChannel returns an error on 32-bit architectures where the Feishu SDK
// is not supported. The signature matches the 64-bit variant so init.go compiles
// on all architectures.
func NewFeishuChannel(cfg config.FeishuConfig, _ credentials.SecretBundle, _ *bus.MessageBus) (*FeishuChannel, error) {
	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",
	)
}

// Start is a stub method to satisfy the Channel interface
func (c *FeishuChannel) Start(ctx context.Context) error {
	return errUnsupported
}

// Stop is a stub method to satisfy the Channel interface
func (c *FeishuChannel) Stop(ctx context.Context) error {
	return errUnsupported
}

// Send is a stub method to satisfy the Channel interface
func (c *FeishuChannel) Send(ctx context.Context, msg bus.OutboundMessage) error {
	return errUnsupported
}

// EditMessage is a stub method to satisfy MessageEditor
func (c *FeishuChannel) EditMessage(ctx context.Context, chatID, messageID, content string) error {
	return errUnsupported
}

// SendPlaceholder is a stub method to satisfy PlaceholderCapable
func (c *FeishuChannel) SendPlaceholder(ctx context.Context, chatID string) (string, error) {
	return "", errUnsupported
}

// ReactToMessage is a stub method to satisfy ReactionCapable
func (c *FeishuChannel) ReactToMessage(ctx context.Context, chatID, messageID string) (func(), error) {
	return func() {}, errUnsupported
}

// SendMedia is a stub method to satisfy MediaSender
func (c *FeishuChannel) SendMedia(ctx context.Context, msg bus.OutboundMediaMessage) error {
	return errUnsupported
}
