from bot.HtmlMsg import HtmlMsg class AdminNotifMsg(HtmlMsg): def get_msg(self, data=None) -> str: if data is None: data = {} cl = "" recipient = "" status = "" if data['admin']['status'] == 2: cl = "Ссылка: {channel_link}\n".format(channel_link=data['post']['channel_link']) if 'recipient_respond' in data: recipient = "Эксперт @{username} откликнулся на вакансию\n".format(username=data['recipient']['username']) if 'status' in data: status = "Статус: {status}\n".format(status=data['status']) ct = "Название: {channel_title}\n".format(channel_title=data['post']['channel_title']) content = "Текст:\n{content}".format(content=data['post']['content']) msg = "{recipient}{status}{cl}{ct}{content}".format(cl=cl, ct=ct, content=content, recipient=recipient, status=status) return self.get_stylized_msg(msg)