1
0
mirror of https://github.com/civsocit/olgram.git synced 2025-12-17 16:06:17 +00:00

minor fixes

This commit is contained in:
mihalin
2022-02-11 21:19:30 +03:00
parent d53a574377
commit a3eb985d28
2 changed files with 19 additions and 6 deletions

View File

@@ -22,8 +22,11 @@ async def edit_or_create(call: CallbackQuery, message: str,
parse_mode=parse_mode)
def button_text_limit(data: str) -> str:
max_len = 30
def wrap(data: str, max_len: int) -> str:
if len(data) > max_len:
data = data[:max_len-4] + "..."
return data
def button_text_limit(data: str) -> str:
return wrap(data, 30)