Template
mirror of
https://github.com/djimboy/djimbo_template_aio3.git
synced 2026-08-26 23:17:43 +00:00
Update
This commit is contained in:
@@ -70,6 +70,23 @@ async def smart_send(bot: Bot, message: types.Message, user_id, text_add=None, r
|
||||
|
||||
|
||||
######################################## ПРОЧЕЕ ########################################
|
||||
# Удаление отступов у текста
|
||||
def ded(get_text: str):
|
||||
if get_text is not None:
|
||||
split_text = get_text.split("\n")
|
||||
if split_text[0] == "": split_text.pop(0)
|
||||
if split_text[-1] == "": split_text.pop(-1)
|
||||
save_text = []
|
||||
|
||||
for text in split_text:
|
||||
while text.startswith(" "):
|
||||
text = text[1:]
|
||||
|
||||
save_text.append(text)
|
||||
get_text = "\n".join(save_text)
|
||||
|
||||
return get_text
|
||||
|
||||
# Очистка HTML тэгов
|
||||
def clear_html(get_text: str):
|
||||
if get_text is not None:
|
||||
|
||||
Reference in New Issue
Block a user