restructure
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2025-03-28 20:26:23 +05:00
parent 0e936fbb40
commit 135ed4fd7a
8 changed files with 2 additions and 3 deletions

View File

@@ -1,44 +0,0 @@
from aiogram import Bot, Dispatcher, types
from aiogram.types import Message, InlineKeyboardMarkup, InlineKeyboardButton
from aiogram.utils import executor
from aiogram.dispatcher.filters import Text
from pomodoro_bot.user_manager import user_manager
from pomodoro_bot.timer_manager import TimerManager
import os
API_TOKEN = os.getenv("BOT_TOKEN")
bot = Bot(token=API_TOKEN)
dp = Dispatcher(bot)
timer_manager = TimerManager(bot)
menu_kb = InlineKeyboardMarkup(row_width=2)
menu_kb.add(
InlineKeyboardButton("▶️ Pomodoro", callback_data="pomodoro"),
InlineKeyboardButton("☕ Short Break", callback_data="shortbreak"),
InlineKeyboardButton("😌 Long Break", callback_data="longbreak"),
InlineKeyboardButton("⏹ Stop", callback_data="stop")
)
@dp.message_handler(commands=['start', 'help'])
async def send_welcome(message: Message):
await message.reply("Привет! Я твой личный Pomodoro-бот. Выбирай действие:", reply_markup=menu_kb)
@dp.callback_query_handler(Text(equals=["pomodoro", "shortbreak", "longbreak", "stop"]))
async def handle_callback(call: types.CallbackQuery):
if call.data == "pomodoro":
await timer_manager.start_timer(call.from_user.id, 25*60, call.message.chat.id, 'Pomodoro')
await call.message.answer("Начался 25-минутный Pomodoro! 🔥")
elif call.data == "shortbreak":
await timer_manager.start_timer(call.from_user.id, 5*60, call.message.chat.id, 'Short Break')
await call.message.answer("Начался 5-минутный перерыв ☕")
elif call.data == "longbreak":
await timer_manager.start_timer(call.from_user.id, 15*60, call.message.chat.id, 'Long Break')
await call.message.answer("Начался длинный перерыв 😌")
elif call.data == "stop":
await timer_manager.stop_timer(call.from_user.id)
await call.message.answer("Таймер остановлен ⏹")
await call.answer()
def run_bot():
executor.start_polling(dp, skip_updates=True)