fix signed message exceeding limit
This commit is contained in:
parent
226bbd5bf7
commit
53a6dc6d7e
6
main.py
6
main.py
@ -124,10 +124,12 @@ def _sign_text(text, m: Message, limit):
|
|||||||
if not text:
|
if not text:
|
||||||
text = ''
|
text = ''
|
||||||
|
|
||||||
|
sign = ''
|
||||||
if text.startswith('!sign') or text.startswith('/sign'):
|
if text.startswith('!sign') or text.startswith('/sign'):
|
||||||
text = text[5:] + f'\n\n____________\n' \
|
sign = f'\n\n____________\n' \
|
||||||
f'by <a href="tg://user?id={m.from_user.id}">{escape(m.from_user.full_name)}</a>'
|
f'by <a href="tg://user?id={m.from_user.id}">{escape(m.from_user.full_name)}</a>'
|
||||||
return text[:limit]
|
|
||||||
|
return text[:limit - len(sign)] + sign
|
||||||
|
|
||||||
|
|
||||||
def _process_message(bot: Bot, m: Message):
|
def _process_message(bot: Bot, m: Message):
|
||||||
|
Loading…
Reference in New Issue
Block a user