Fix a msg bug

This commit is contained in:
xtaodada 2022-03-20 13:11:38 +08:00
parent 4a39d35f15
commit b08cda5995
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659
2 changed files with 6 additions and 3 deletions

View File

@ -55,7 +55,7 @@ def gen_tags(data: Module) -> str:
def gen_update_msg(data: Module) -> TrackMessage:
text = template.format(gen_tags(data), data.name, data.description, data.latestRelease,
data.updatedAt,
data.releases[0].description.replace(r"\r\n", "\n")[:1000].strip())
data.releases[0].description.replace(r"\r\n", "\n")[:250].strip())
url = None
name = None
if data.releases:

View File

@ -3,7 +3,7 @@ from asyncio import sleep
from os import remove
from random import uniform
from pyrogram.errors import FloodWait, ButtonUrlInvalid
from pyrogram.errors import FloodWait, ButtonUrlInvalid, MediaCaptionTooLong
from pyrogram.types import Message
from ci import app, scheduler, channel_id, admin_id, sqlite
@ -67,7 +67,10 @@ async def run_every_30_minute():
traceback.print_exc()
await sleep(uniform(0.5, 2.0))
data_ = sqlite.get(i.name, {"msg_link": ""})
data_["msg_link"] = msg.link
if msg:
data_["msg_link"] = msg.link
else:
data_["msg_link"] = "https://t.me/lsposed_Modules_Updates_Tracker"
sqlite[i.name] = data_
await send_to_subscribes(i)
await sleep(uniform(0.5, 2.0))