Karma
commited on
Commit
·
51b00d5
1
Parent(s):
f46c052
Update misc.py
Browse files
Mikobot/plugins/helper_funcs/misc.py
CHANGED
@@ -12,7 +12,7 @@ from telegram import (
|
|
12 |
InlineQueryResultArticle,
|
13 |
InputTextMessageContent,
|
14 |
)
|
15 |
-
from telegram.constants import
|
16 |
from telegram.error import TelegramError
|
17 |
|
18 |
from Mikobot import NO_LOAD
|
@@ -33,14 +33,14 @@ class EqInlineKeyboardButton(InlineKeyboardButton):
|
|
33 |
|
34 |
|
35 |
def split_message(msg: str) -> List[str]:
|
36 |
-
if len(msg) < MAX_TEXT_LENGTH:
|
37 |
return [msg]
|
38 |
|
39 |
lines = msg.splitlines(True)
|
40 |
small_msg = ""
|
41 |
result = []
|
42 |
for line in lines:
|
43 |
-
if len(small_msg) + len(line) < MAX_TEXT_LENGTH:
|
44 |
small_msg += line
|
45 |
else:
|
46 |
result.append(small_msg)
|
|
|
12 |
InlineQueryResultArticle,
|
13 |
InputTextMessageContent,
|
14 |
)
|
15 |
+
from telegram.constants import MessageLimit, ParseMode
|
16 |
from telegram.error import TelegramError
|
17 |
|
18 |
from Mikobot import NO_LOAD
|
|
|
33 |
|
34 |
|
35 |
def split_message(msg: str) -> List[str]:
|
36 |
+
if len(msg) < MessageLimit.MAX_TEXT_LENGTH:
|
37 |
return [msg]
|
38 |
|
39 |
lines = msg.splitlines(True)
|
40 |
small_msg = ""
|
41 |
result = []
|
42 |
for line in lines:
|
43 |
+
if len(small_msg) + len(line) < MessageLimit.MAX_TEXT_LENGTH:
|
44 |
small_msg += line
|
45 |
else:
|
46 |
result.append(small_msg)
|