~mendelmaleh/tg_translator

e4100c639ea8ab52ba3f184768909cae73c4e88b — Mendel E 2 years ago ff51b82
Add edited tag
1 files changed, 2 insertions(+), 1 deletions(-)

M main.py
M main.py => main.py +2 -1
@@ 19,10 19,11 @@ bot = Client("bot", api_id, api_hash, bot_token=config["bot"]["token"])
async def translate(cl: Client, msg: Message):
    if not (msg.text or msg.caption):
        return
    text = tr.translate(msg.text or msg.caption).text

    await bot.send_message(
        chat_id=channels[msg.chat.id],
        text='\n\n'.join([msg.link, tr.translate(msg.text or msg.caption).text]),
        text=f"{msg.link}{' (edited)' if msg.edit_date else ''}\n\n{text}",
        disable_web_page_preview=bool(msg.text)
    )