Fix a msg bug
This commit is contained in:
parent
4a39d35f15
commit
b08cda5995
@ -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:
|
||||
|
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user