From 966e5ec7993f7cf7abeb51d0b2cabeee1fc2b697 Mon Sep 17 00:00:00 2001 From: blank X Date: Fri, 4 Sep 2020 21:52:30 +0700 Subject: [PATCH] Turns out, captions can only be 1024 characters long --- redditbot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/redditbot.py b/redditbot.py index 4104780..ebde9a7 100644 --- a/redditbot.py +++ b/redditbot.py @@ -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'{zws}{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: