tg_bot/msg/AdminNotifMsg.py
2024-12-06 14:20:29 +03:00

23 lines
1.0 KiB
Python

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 = "<b>Ссылка:</b> {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 = "Статус: <b>{status}</b>\n".format(status=data['status'])
ct = "<b>Название:</b> {channel_title}\n".format(channel_title=data['post']['channel_title'])
content = "<b>Текст:</b>\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)