Template
mirror of
https://github.com/djimboy/djimbo_template_aio3.git
synced 2026-08-27 23:47:44 +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:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,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>")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user