Turns out, captions can only be 1024 characters long
This commit is contained in:
parent
59506a4d48
commit
966e5ec799
|
@ -225,7 +225,7 @@ async def main():
|
|||
desc = i['description']
|
||||
if desc:
|
||||
to_append += ': ' + desc.strip()
|
||||
caplength = 2047 - len(client.parse_mode.parse(text)[0])
|
||||
caplength = 1023 - len(client.parse_mode.parse(text)[0])
|
||||
captext = to_append[:caplength]
|
||||
if len(captext) >= caplength:
|
||||
captext = captext[:-1]
|
||||
|
@ -288,7 +288,7 @@ async def main():
|
|||
else:
|
||||
tat = f'<a href="{url}">{zws}</a>{tat}'
|
||||
if pdesc:
|
||||
caplength = 2047 if pimg else 4095
|
||||
caplength = 1023 if pimg else 4095
|
||||
caplength -= len(client.parse_mode.parse(tat)[0])
|
||||
captext = pdesc[:caplength]
|
||||
if len(captext) >= caplength:
|
||||
|
|
Loading…
Reference in New Issue