from __future__ import annotations
from dataclasses import dataclass, field
from typing import Any, Optional

import discord

@dataclass(slots=True)
class GameCtx:
    guild_id: int
    channel_id: int
    game_name: str
    session_id: str
    phase: str = "unknown"
    player_id: Optional[int] = None
    in_game: bool = False
    is_host: bool = False
    meta: dict[str, Any] = field(default_factory=dict)

@dataclass(slots=True)
class ButtonCtx:
    interaction: discord.Interaction
    game_ctx: GameCtx
    action: str
    payload: dict[str, Any]