from abc import ABC, abstractmethod

from core.util import logs


class ClientBase(ABC):
    def __init__(self, ur, loop, service):
        self.ur = ur
        self.loop = loop
        self.service = service
        self.log = logs.get_logger(service)
        self.log.info(f"{self.service.capitalize()} client initialising...")

    @abstractmethod
    def start(self): ...

    # @abstractmethod
    # async def send_message(self, recipient, message):
    #     """Abstract method for sending messages."""
    #     ...

    async def message_received(self, *args, **kwargs):
        await self.ur.message_received(self.service, *args, **kwargs)

    async def message_read(self, *args, **kwargs):
        await self.ur.message_read(self.service, *args, **kwargs)

    async def started_typing(self, *args, **kwargs):
        await self.ur.started_typing(self.service, *args, **kwargs)

    async def stopped_typing(self, *args, **kwargs):
        await self.ur.stopped_typing(self.service, *args, **kwargs)

    async def reacted(self, *args, **kwargs):
        await self.ur.reacted(self.service, *args, **kwargs)

    async def replied(self, *args, **kwargs):
        await self.ur.replied(self.service, *args, **kwargs)
