It's version 0.4

This commit is contained in:
Niken
2025-10-19 14:28:41 +03:00
parent 772d3d5b83
commit 7b653d4dcc
32 changed files with 775 additions and 326 deletions
+3 -3
View File
@@ -5,10 +5,11 @@ from models.state import BotState
from config import Config
import logging
from utils.antispam import admin_required
from storage.message_storage import save_message # импортируем функцию
from storage.message_storage import save_message # импортируем функцию
logger = logging.getLogger(__name__)
def register_handlers(dp: Dispatcher, state: BotState, bot: Bot):
@dp.message(Command("hello"))
@admin_required(1)
@@ -20,8 +21,7 @@ def register_handlers(dp: Dispatcher, state: BotState, bot: Bot):
try:
name = Config.Names.get(admin_id, "Админ")
msg = await bot.send_message(
chat_id=admin_id,
text=f"🤖 Я готов к работе, господин {name}!"
chat_id=admin_id, text=f"🤖 Я готов к работе, господин {name}!"
)
# сохраняем сообщение, отправленное админу
save_message(msg.chat.id, msg.message_id)