from messagebus import (
    Message,
    MessageBus,
)


class MBEasyContext(object):
    def __init__(self, message_bus: MessageBus):
        self.message_bus = message_bus

    def MB_ReplyMessage(self, msg, format, data):
        self.message_bus.reply_message(
            message=getattr(msg, "_message"),
            reply_message=Message(
                token=msg.token,
                data_type=format,
                data=data,
            )
        )
