This commit is contained in:
djimbo
2022-09-24 20:38:34 +03:00
parent 359b9717ec
commit 9213a80cb9
16 changed files with 77 additions and 49 deletions
+17
View File
@@ -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:
+1 -1
View File
@@ -1,5 +1,5 @@
# - *- coding: utf- 8 - *-
from aiogram.dispatcher.filters import BaseFilter
from aiogram.filters import BaseFilter
from aiogram.types import Message
from tgbot.data.config import get_admins
+3 -6
View File
@@ -1,10 +1,7 @@
# - *- coding: utf- 8 - *-
from textwrap import dedent
from aiogram.fsm.context import FSMContext
from aiogram.dispatcher.fsm.context import FSMContext
from tgbot.services.api_session import AsyncSession
from tgbot.services.api_session import RequestsSession
ded = dedent
FSM = FSMContext
RS = RequestsSession
AS = AsyncSession
+2 -2
View File
@@ -2,13 +2,13 @@
from aiogram import Bot
from aiogram.types import FSInputFile
from tgbot.data.config import get_admins, PATH_DATABASE
from tgbot.data.config import get_admins, PATH_DATABASE, start_status
from tgbot.utils.const_functions import get_date, send_admins
# Выполнение функции после запуска бота (рассылка админам о запуске бота)
async def startup_notify(bot: Bot):
if len(get_admins()) >= 1:
if len(get_admins()) >= 1 and start_status:
await send_admins(bot, "<b>✅ Бот был запущен</b>")