🐛 Fix missing mime
This commit is contained in:
parent
b126213c49
commit
fe641bbe42
@ -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)
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user