From fe641bbe42e8ba1a51f7d8fe4cedb2df867387c5 Mon Sep 17 00:00:00 2001 From: xtaodada Date: Sun, 20 Mar 2022 02:23:27 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20missing=20mime?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- defs/msg.py | 4 +++- plugins/track.py | 2 -- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/defs/msg.py b/defs/msg.py index eadb36a..0fd59c5 100644 --- a/defs/msg.py +++ b/defs/msg.py @@ -42,9 +42,11 @@ def gen_update_msg(data: Module) -> TrackMessage: data.updatedAt, data.releases[0].description.replace(r"\r\n", "\n")) url = None + name = data.name.replace('.', '_') + "-" + data.latestRelease if data.releases: if data.releases[0].releaseAssets: url = data.releases[0].releaseAssets[0].url - name = data.name.replace('.', '_') + "-" + data.latestRelease + mime = data.releases[0].releaseAssets[0].name.split(".")[-1:][0] + name += "." + mime button = gen_button(data) return TrackMessage(text, url, name, button) diff --git a/plugins/track.py b/plugins/track.py index f5c5f08..db1061f 100644 --- a/plugins/track.py +++ b/plugins/track.py @@ -16,7 +16,6 @@ async def send_track_msg(file, track_msg): if file: await app.send_document(channel_id, file, caption=track_msg.text[:1000], - file_name=track_msg.name, force_document=True, parse_mode="html", reply_markup=track_msg.button) @@ -44,7 +43,6 @@ async def run_every_30_minute(): print(f"Send button error") await app.send_document(channel_id, file, caption=track_msg.text, - file_name=track_msg.name, force_document=True, parse_mode="html",) except Exception as e: