initial project version
This commit is contained in:
0
src/modules/__init__.py
Normal file
0
src/modules/__init__.py
Normal file
16
src/modules/start.py
Normal file
16
src/modules/start.py
Normal file
@ -0,0 +1,16 @@
|
||||
from telebot.async_telebot import AsyncTeleBot
|
||||
import logging
|
||||
|
||||
from config import MESSAGE_FOR_START
|
||||
|
||||
logger = logging.getLogger(__name__) # Получаем логгер для текущего модуля
|
||||
|
||||
def register_handlers(bot: AsyncTeleBot): # Регистрирует все обработчики команд
|
||||
|
||||
@bot.message_handler(commands=['start']) # Обработчик команды /start
|
||||
async def start_command(message):
|
||||
try:
|
||||
logger.info(f"Команда START ({message.from_user.id})")
|
||||
await bot.send_message(message.chat.id, MESSAGE_FOR_START)
|
||||
except Exception as e:
|
||||
logger.error(f"Команда START ({message.from_user.id}) {str(e)}")
|
Reference in New Issue
Block a user