From eaa5579b90e0779e1afb984f7b5860cb6d9b599d Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 4 Jan 2025 03:34:42 +0300 Subject: [PATCH] Prevent handling yourself victims backup if not json --- src/victimsbackup.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/victimsbackup.py b/src/victimsbackup.py index 7095715..6b21eae 100644 --- a/src/victimsbackup.py +++ b/src/victimsbackup.py @@ -6,11 +6,13 @@ Currently supported original avocado json backup and "aska" txt backups # TODO: make support for zipped and multiple files # make some user_id checks before add (too slow) +from s import termux_api from loguru import logger from telethon import events from datetime import datetime import json import re +import os async def bio_backup_stealing(client, c, conn, default_directory): @@ -36,6 +38,9 @@ async def bio_backup_stealing(client, c, conn, default_directory): file_format = 'json' await event.edit('Processing json victims...') elif file_path.lower().endswith('.txt'): + if cmd == 'me': + await event.edit('Your backup should be json avocado victims file') + return raw_victims = stealed_backup.readlines() file_format = 'txt' await event.edit('Processing raw txt victims...') @@ -99,6 +104,8 @@ async def bio_backup_stealing(client, c, conn, default_directory): conn.commit() logger.success('database rebased') logger.success('backup success stealed') + if termux_api: + os.system("termux-toast -b black -c green 'Your victims backup imported in database'") del my_victims_ids del victims # free memory del raw_victims