diff --git a/ubot.py b/ubot.py index 0407121..a1653a6 100644 --- a/ubot.py +++ b/ubot.py @@ -33,7 +33,7 @@ if is_termux: logger.warning('F-droid termux release here: https://f-droid.org/en/packages/com.termux/') logger.warning('Github termux release here: https://github.com/termux/termux-app/releases') if int(os.environ.get('TERMUX_VERSION').split('.')[1]) < 118: - logger.warning('You use old version of termux, highly recommended that you update to v0.118.0 or higher ASAP for various bug fixes, including a critical world-readable vulnerability') + logger.warning('You use old version of termux, highly recommended that you update to v0.119.0 or higher ASAP for various bug fixes, including a critical world-readable vulnerability') if os.access('/sdcard', os.W_OK): logger.success('permission to write on internal storage allowed') else: @@ -593,7 +593,43 @@ async def main(): for patient in bioebbing_ids: await asyncio.sleep(random.uniform(1.234, 4.222)) await event.respond(f'биоеб {patient}') - + + + @client.on(events.NewMessage(pattern='.+Резервная копия жертв')) + async def infection_not_found(event): + m = event.message + if m.sender_id == 6333102398 and event.chat_id == 6333102398: + file_path = await m.download_media(file=f"{default_directory}") + print(f'backup file saved to {file_path}') + added = 0 + victims = None + raw_victims = None + file_format = None + with open(file_path, 'r') as stealed_backup: + if file_path.lower().endswith('.json'): + victims = json.load(stealed_backup) + file_format = 'json' + my_victims_ids = [] + added = 0 + for v in victims: + u_id = int(v['user_id']) + profit= v['profit'] + when = v['from_infect'] + expr = v['until_infect'] + if db_sqlite3: + try: + c.execute("INSERT INTO avocado(user_id,when_int,bio_str,bio_int,expr_int) VALUES (?, ?, ?, ?, ?)", (int(u_id),int(when),str(profit),int(profit),int(expr))); conn.commit()# save my + print(f'''[@{u_id}] +{profit}''')# показать + added+=1 + except: + try: + c.execute("UPDATE avocado SET when_int = :wh, bio_int = :xpi, expr_int = :expr WHERE user_id = :z AND when_int < :wh AND expr_int < :expr;", {"wh":int(when),"xpi":int(profit),"xpi":int(profit),"z":int(u_id)}); conn.commit() + except Exception as Err: + print(f'err: {Err} avocado backup') + # pass + print(f'added: {added}') + + @client.on(events.NewMessage(outgoing=True, pattern=r'\.biostealbackup')) async def bio_steal_backup(event): cmd = event.text.split(' ', 1)