# Path: vkapi/utils.py
# CONF_START = 2000000000
# 
# Path: vkbot_message.py
# class PeerInfo:
# 
#     def __init__(self, user_id, chat_id=None):
#         self.user_id = user_id
#         self.chat_id = chat_id
# 
#     @property
#     def peer_id(self):
#         if self.chat_id is not None:
#             return CONF_START + self.chat_id
#         return self.user_id
# 
#     @property
#     def is_chat(self):
#         return self.chat_id is not None


import enum
from vkapi.utils import CONF_START
from vkbot_message import PeerInfo


class BotResponse:
    def __init__(self, message, type, data=None, onsend_actions=()):
        self.type = type
        self.user_id = message.user_id
        self.peer_id = message.peer_id
        self.message_body = message.body
        self.message_id = message.id
        self.message_has_action = bool(message.action)
        self.data = data
        self.onsend_actions = list(onsend_actions)

    def fake_message(self):
        if self.peer_id == self.user_id:
            return {'user_id': self.user_id}
        else:
            return {'user_id': self.user_id, 'chat_id': self.peer_id - CONF_START}

    @property
    def is_chat(self):
        return self.peer_id > CONF_START

    @property
    def text(self):
        return self.data if self.type == ResponseType.TEXT else ''

    def get_peer_info(self):
        if self.peer_id == self.user_id:
            return PeerInfo(self.user_id)

# Path: vkapi/utils.py
# CONF_START = 2000000000
# 
# Path: vkbot_message.py
# class PeerInfo:
# 
#     def __init__(self, user_id, chat_id=None):
#         self.user_id = user_id
#         self.chat_id = chat_id
# 
#     @property
#     def peer_id(self):
#         if self.chat_id is not None:
#             return CONF_START + self.chat_id
#         return self.user_id
# 
#     @property
#     def is_chat(self):
#         return self.chat_id is not None


# Path: bot_response.py
import enum
from vkapi.utils import CONF_START
from vkbot_message import PeerInfo



class BotResponse:
    def __init__(self, message, type, data=None, onsend_actions=()):
        self.type = type
        self.user_id = message.user_id
        self.peer_id = message.peer_id
        self.message_body = message.body
        self.message_id = message.id
        self.message_has_action = bool(message.action)
        self.data = data
        self.onsend_actions = list(onsend_actions)

    def fake_message(self):
        if self.peer_id == self.user_id:
            return {'user_id': self.user_id}
        else:
            return {'user_id': self.user_id, 'chat_id': self.peer_id - CONF_START}

    @property
    def is_chat(self):
        return self.peer_id > CONF_START

    @property
    def text(self):
        return self.data if self.type == ResponseType.TEXT else ''

    def get_peer_info(self):
        if self.peer_id == self.user_id:
            return PeerInfo(self.user_id)

        return PeerInfo(self.user_id, self.peer_id - CONF_START)