<filename>Slasher/models/Interaction.py
from enum import Enum
from typing import List, Mapping

from Slasher.models.Channel import Channel
from Slasher.models.Member import Member
from Slasher.models.Role import Role
from Slasher.models.Snowflake import Snowflake
from Slasher.models.User import User


class InteractionType(Enum):
    PING = 1
    APPLICATION_COMMAND = 2
    MESSAGE_COMPONENT = 3


class OptionType(Enum):
    SUB_COMMAND = 1
    SUB_COMMAND_GROUP = 2
    STRING = 3
    INTEGER = 4	 # Any integer between -2^53 and 2^53
    BOOLEAN = 5
    USER = 6
    CHANNEL = 7  # Includes all channel types + categories
    ROLE = 8
    MENTIONABLE = 9  # Includes users and roles
    NUMBER = 10  # Any double between -2^53 and 2^53


class ResolvedData:
    def __init__(
            self,
            users: Mapping[int, User],
            members: Mapping[int, Member],
            roles: Mapping[int, Role],
            channels: Mapping[int, Channel],
            messages: Mapping[int, Message]) -> None:
        pass


class InteractionOption:
    def __init__(
            self,
            name: str,
            type: int,
            *,  # Optionals
            value: OptionType,
            options: List["InteractionOption"]) -> None:
        pass


class InteractionData:
    def __init__(
            self,
            id: Snowflake,
            name: str,
            type: int,
            *,  # Optionals
            resolved: ResolvedData,
            options: List[InteractionOption],
            custom_id: str,
            component_type: int,
            values: List[SelectedOption],
            target_id: Snowflake) -> None:
        pass


class Interaction:
    def __init__(
            self,
            id: Snowflake,
            application_id: Snowflake,
            type_: InteractionType,
            token: str,
            version: int,
            *,  # Optionals
            data: InteractionData,
            guild_id: Snowflake,
            channel_id: Snowflake,
            member: Member,
            user: User,
            message: Message) -> None:

        self.id = id
        self.application_id = application_id
        self.type = type_
        self.token = token
        self.version = version
        self.data = data
        self.guild_i = guild_id
        self.channel_id = channel_id
        self.member = member
        self.user = user
        self.message = message
