This commit is contained in:
Yuriy Yuriev
2026-07-08 01:09:53 +07:00
parent 44ce29d2e0
commit 6264b24f8f
-19
View File
@@ -975,13 +975,6 @@ class BotInterface:
await callback.answer("❌ Недостаточно баланса", show_alert=True) await callback.answer("❌ Недостаточно баланса", show_alert=True)
return return
all_tasks = await interface.task_manager.get_all_tasks() all_tasks = await interface.task_manager.get_all_tasks()
active_count = sum(
1 for p in all_tasks.values()
if p.user_id == uid and not p.completed and not p.stopped
)
if active_count >= 3:
await callback.answer("❌ Максимум 3 активные задачи", show_alert=True)
return
builder = InlineKeyboardBuilder() builder = InlineKeyboardBuilder()
builder.row(InlineKeyboardButton(text="📺 Twitch мониторинг", callback_data="task_type_twitch")) builder.row(InlineKeyboardButton(text="📺 Twitch мониторинг", callback_data="task_type_twitch"))
builder.row(InlineKeyboardButton(text="🔗 Посещение по ссылке", callback_data="task_type_url")) builder.row(InlineKeyboardButton(text="🔗 Посещение по ссылке", callback_data="task_type_url"))
@@ -2729,18 +2722,6 @@ class BotInterface:
await message.answer("❌ Неверное название канала (только буквы, цифры, _). Попробуйте ещё раз:") await message.answer("❌ Неверное название канала (только буквы, цифры, _). Попробуйте ещё раз:")
return return
channel = text.lower() channel = text.lower()
# Проверка на дубликат
all_tasks = await self.task_manager.get_all_tasks()
duplicate = any(
p.user_id == user_id and p.channel == channel and not p.completed and not p.stopped
for p in all_tasks.values()
)
if duplicate:
await self._send_temp(
message,
f"❌ У вас уже есть активная задача для канала `{channel}`.\nВведите другой канал:"
)
return
# Удаляем промпт шага 1 перед отправкой шага 2 # Удаляем промпт шага 1 перед отправкой шага 2
if user_id in self._menu_msg: if user_id in self._menu_msg:
await self._safe_delete(message.bot, message.chat.id, self._menu_msg.pop(user_id)) await self._safe_delete(message.bot, message.chat.id, self._menu_msg.pop(user_id))