from tgbot.entities import *
from tgbot.entities.files import *
from tgbot.entities.location import *

class Chat(RequestingEntity):
    def __init__(self, api):
        RequestingEntity.__init__(self, {
            "id":           ("id", None),
            "type":         ("type", None),
            "title":        ("title", None),
            "username":     ("username", None),
            "first_name":   ("first_name", None),
            "last_name":    ("last_name", None)
        }, api)

    def send_message(self, text = "", parse_mode = None, disable_web_page_review = False, disable_notification = False, reply_to_message = None, reply_markup = None):
        if self.id == None or self.api == None: raise Exception("Can't send API requests with this chat instance")
        return self.api.send_message(
            chat_id = self.id,
            text = text,
            parse_mode = parse_mode,
            disable_web_page_review = disable_web_page_review,
            disable_notification = disable_notification,
            reply_to_message_id = reply_to_message.id if reply_to_message != None else None,