from dataclasses import dataclass
from typing import Callable, Dict, Literal, Optional

ChannelId = Literal["discord", "telegram", "whatsapp"]
ChannelMessageActionName = Literal["send", "poll", "broadcast", "react", "delete"]


@dataclass
class ChannelActionContext:
    channel: ChannelId
    action: ChannelMessageActionName
    params: Dict[str, object]
    account_id: Optional[str] = None


ActionHandler = Callable[[ChannelActionContext], Dict[str, object]]


@dataclass
class ChannelPlugin:
    id: ChannelId
    handle_action: ActionHandler

