package discord

import (
	"context"
	"fmt"

	"git.yeij.top/AskaEth/Cyrene/platform-bridge/internal/bridge"
)

// Adapter implements PlatformAdapter for Discord Bot API.
// Currently a stub — requires Discord bot token and discordgo library.
type Adapter struct{}

func NewAdapter() *Adapter { return &Adapter{} }

func (a *Adapter) PlatformName() string { return "discord" }

func (a *Adapter) Capabilities() bridge.PlatformCapabilities {
	return bridge.PlatformCapabilities{
		MaxMessageLength:   2000,
		SupportsMarkdown:   true,
		SupportsImage:      true,
		SupportsVoice:      false,
		SupportsEmoji:      true,
		SupportsReaction:   true,
		SupportsTypingHint: true,
		RecommendBurstMax:  3,
	}
}

func (a *Adapter) Connect(ctx context.Context) error {
	fmt.Println("[discord] stub adapter — requires Discord bot token and discordgo")
	return nil
}

func (a *Adapter) Disconnect(ctx context.Context) error { return nil }

func (a *Adapter) IsConnected() bool { return false }

func (a *Adapter) HealthCheck() error {
	return fmt.Errorf("discord adapter is a stub — not connected to Discord")
}

func (a *Adapter) ToUnified(rawMessage interface{}) (*bridge.UnifiedMessage, error) {
	return nil, fmt.Errorf("discord adapter is a stub — implement with discordgo")
}

func (a *Adapter) FromUnified(response *bridge.UnifiedResponse) ([]bridge.PlatformMessage, error) {
	return nil, fmt.Errorf("discord adapter is a stub")
}
