Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified__pycache__/main.cpython-313.pyc
Binary file not shown.
30 changes: 29 additions & 1 deletion github_menu_handler.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -485,6 +485,9 @@ async def handle_menu_callback(self, update: Update, context: ContextTypes.DEFAU
elif query.data == "confirm_delete_file":
await self.confirm_delete_file(update, context)

elif query.data == "confirm_delete_repo_step1":
await self.confirm_delete_repo_step1(update, context)

elif query.data == "confirm_delete_repo":
await self.confirm_delete_repo(update, context)

Expand DownExpand Up@@ -1229,7 +1232,7 @@ async def show_repos(
async def upload_saved_files(self, update: Update, context: ContextTypes.DEFAULT_TYPE):
"""מציג רשימת קבצים שמורים להעלאה"""
user_id = update.effective_user.id
session = self.user_sessions.get(user_id, {})
session = self.get_user_session(user_id)

if not session.get("selected_repo"):
await update.callback_query.answer("❌ נא לבחור ריפו קודם")
Expand DownExpand Up@@ -2158,6 +2161,26 @@ async def confirm_delete_file(self, update: Update, context: ContextTypes.DEFAUL
context.user_data.pop("pending_delete_file_path", None)
await self.github_menu_command(update, context)

async def confirm_delete_repo_step1(self, update: Update, context: ContextTypes.DEFAULT_TYPE):
"""מסך אישור סופי לפני מחיקת ריפו, מפנה ללחצן מחיקה סופי"""
query = update.callback_query
session = self.get_user_session(query.from_user.id)
repo = session.get("selected_repo")
if not repo:
await query.edit_message_text("❌ לא נבחר ריפו")
return
keyboard = [
[InlineKeyboardButton("🧨 כן, מחק לצמיתות", callback_data="confirm_delete_repo")],
[InlineKeyboardButton("🔙 ביטול", callback_data="github_menu")],
]
await query.edit_message_text(
f"⚠️ אישור סופי למחיקת <code>{repo}</code>\n\n"
"פעולה זו תמחק לצמיתות את הריפו וכל התוכן המשויך אליו.\n"
"אין דרך לשחזר לאחר מכן.",
reply_markup=InlineKeyboardMarkup(keyboard),
parse_mode="HTML",
)

async def confirm_delete_repo(self, update: Update, context: ContextTypes.DEFAULT_TYPE):
"""מבצע מחיקת ריפו שלם לאחר אישור"""
query = update.callback_query
Expand DownExpand Up@@ -3023,6 +3046,11 @@ async def git_checkpoint(self, update: Update, context: ContextTypes.DEFAULT_TYP
if not token or not repo_full:
await query.edit_message_text("❌ חסר טוקן או ריפו נבחר")
return
# Acknowledge the callback early to avoid Telegram timeout spinner
try:
await query.answer("יוצר נקודת שמירה...", show_alert=False)
except Exception:
pass
try:
import datetime
g = Github(login_or_token=token)
Expand Down
Loading