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']
|
desc = i['description']
|
||||||
if desc:
|
if desc:
|
||||||
to_append += ': ' + desc.strip()
|
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]
|
captext = to_append[:caplength]
|
||||||
if len(captext) >= caplength:
|
if len(captext) >= caplength:
|
||||||
captext = captext[:-1]
|
captext = captext[:-1]
|
||||||
|
@ -288,7 +288,7 @@ async def main():
|
||||||
else:
|
else:
|
||||||
tat = f'<a href="{url}">{zws}</a>{tat}'
|
tat = f'<a href="{url}">{zws}</a>{tat}'
|
||||||
if pdesc:
|
if pdesc:
|
||||||
caplength = 2047 if pimg else 4095
|
caplength = 1023 if pimg else 4095
|
||||||
caplength -= len(client.parse_mode.parse(tat)[0])
|
caplength -= len(client.parse_mode.parse(tat)[0])
|
||||||
captext = pdesc[:caplength]
|
captext = pdesc[:caplength]
|
||||||
if len(captext) >= caplength:
|
if len(captext) >= caplength:
|
||||||
|
|
Loading…
Reference in New Issue