CliRemote 1.7.0__tar.gz → 1.7.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. {cliremote-1.7.0 → cliremote-1.7.2}/CliRemote.egg-info/PKG-INFO +1 -1
  2. {cliremote-1.7.0 → cliremote-1.7.2}/PKG-INFO +1 -1
  3. {cliremote-1.7.0 → cliremote-1.7.2}/pyproject.toml +1 -1
  4. {cliremote-1.7.0 → cliremote-1.7.2}/remote/account_manager.py +148 -0
  5. {cliremote-1.7.0 → cliremote-1.7.2}/setup.py +1 -1
  6. {cliremote-1.7.0 → cliremote-1.7.2}/CliRemote.egg-info/SOURCES.txt +0 -0
  7. {cliremote-1.7.0 → cliremote-1.7.2}/CliRemote.egg-info/dependency_links.txt +0 -0
  8. {cliremote-1.7.0 → cliremote-1.7.2}/CliRemote.egg-info/requires.txt +0 -0
  9. {cliremote-1.7.0 → cliremote-1.7.2}/CliRemote.egg-info/top_level.txt +0 -0
  10. {cliremote-1.7.0 → cliremote-1.7.2}/LICENSE +0 -0
  11. {cliremote-1.7.0 → cliremote-1.7.2}/MANIFEST.in +0 -0
  12. {cliremote-1.7.0 → cliremote-1.7.2}/README.md +0 -0
  13. {cliremote-1.7.0 → cliremote-1.7.2}/remote/__init__.py +0 -0
  14. {cliremote-1.7.0 → cliremote-1.7.2}/remote/account_viewer.py +0 -0
  15. {cliremote-1.7.0 → cliremote-1.7.2}/remote/admin_manager.py +0 -0
  16. {cliremote-1.7.0 → cliremote-1.7.2}/remote/analytics_manager.py +0 -0
  17. {cliremote-1.7.0 → cliremote-1.7.2}/remote/batch_manager.py +0 -0
  18. {cliremote-1.7.0 → cliremote-1.7.2}/remote/block_manager.py +0 -0
  19. {cliremote-1.7.0 → cliremote-1.7.2}/remote/caption_manager.py +0 -0
  20. {cliremote-1.7.0 → cliremote-1.7.2}/remote/cleaner.py +0 -0
  21. {cliremote-1.7.0 → cliremote-1.7.2}/remote/client_manager.py +0 -0
  22. {cliremote-1.7.0 → cliremote-1.7.2}/remote/client_picker.py +0 -0
  23. {cliremote-1.7.0 → cliremote-1.7.2}/remote/config.py +0 -0
  24. {cliremote-1.7.0 → cliremote-1.7.2}/remote/device_manager.py +0 -0
  25. {cliremote-1.7.0 → cliremote-1.7.2}/remote/file_sender.py +0 -0
  26. {cliremote-1.7.0 → cliremote-1.7.2}/remote/getcode_controller.py +0 -0
  27. {cliremote-1.7.0 → cliremote-1.7.2}/remote/health.py +0 -0
  28. {cliremote-1.7.0 → cliremote-1.7.2}/remote/help_menu.py +0 -0
  29. {cliremote-1.7.0 → cliremote-1.7.2}/remote/init.py +0 -0
  30. {cliremote-1.7.0 → cliremote-1.7.2}/remote/join_controller.py +0 -0
  31. {cliremote-1.7.0 → cliremote-1.7.2}/remote/joiner.py +0 -0
  32. {cliremote-1.7.0 → cliremote-1.7.2}/remote/leave_controller.py +0 -0
  33. {cliremote-1.7.0 → cliremote-1.7.2}/remote/lefter.py +0 -0
  34. {cliremote-1.7.0 → cliremote-1.7.2}/remote/mention_manager.py +0 -0
  35. {cliremote-1.7.0 → cliremote-1.7.2}/remote/precise_engine.py +0 -0
  36. {cliremote-1.7.0 → cliremote-1.7.2}/remote/profile_info.py +0 -0
  37. {cliremote-1.7.0 → cliremote-1.7.2}/remote/profile_media.py +0 -0
  38. {cliremote-1.7.0 → cliremote-1.7.2}/remote/profile_privacy.py +0 -0
  39. {cliremote-1.7.0 → cliremote-1.7.2}/remote/spammer.py +0 -0
  40. {cliremote-1.7.0 → cliremote-1.7.2}/remote/speed_manager.py +0 -0
  41. {cliremote-1.7.0 → cliremote-1.7.2}/remote/stop_manager.py +0 -0
  42. {cliremote-1.7.0 → cliremote-1.7.2}/remote/text_manager.py +0 -0
  43. {cliremote-1.7.0 → cliremote-1.7.2}/remote/username_manager.py +0 -0
  44. {cliremote-1.7.0 → cliremote-1.7.2}/remote/utils/__init__.py +0 -0
  45. {cliremote-1.7.0 → cliremote-1.7.2}/remote/utils/sqlite_utils.py +0 -0
  46. {cliremote-1.7.0 → cliremote-1.7.2}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: CliRemote
3
- Version: 1.7.0
3
+ Version: 1.7.2
4
4
  Summary: Remote client framework for Telegram automation using Pyrogram
5
5
  Home-page: https://github.com/MohammadAhmadi-R/CliRemote
6
6
  Author: MrAhmadiRad
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: CliRemote
3
- Version: 1.7.0
3
+ Version: 1.7.2
4
4
  Summary: Remote client framework for Telegram automation using Pyrogram
5
5
  Home-page: https://github.com/MohammadAhmadi-R/CliRemote
6
6
  Author: MrAhmadiRad
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "CliRemote"
7
- version = "1.7.0"
7
+ version = "1.7.2"
8
8
  description = "Remote client framework for Telegram automation using Pyrogram"
9
9
  readme = "README.md"
10
10
  license = {text = "MIT"}
@@ -244,3 +244,151 @@ def accounts() -> List[str]:
244
244
 
245
245
  def get_active_accounts() -> Set[str]:
246
246
  return set(accounts())
247
+
248
+
249
+ login = {}
250
+
251
+ # ==========================
252
+ # افزودن اکانت جدید
253
+ # ==========================
254
+ async def add_account_cmd(message, get_app_info):
255
+ try:
256
+ parts = message.text.split(' ', 1)
257
+ if len(parts) < 2:
258
+ await message.reply('مثال: `add +989123456789`')
259
+ return
260
+
261
+ phone_number = parts[1].strip()
262
+ session_file = os.path.join(ACCOUNTS_FOLDER, f'{phone_number}.session')
263
+
264
+ if os.path.exists(session_file):
265
+ await message.reply('این اکانت وجود دارد!')
266
+ return
267
+
268
+ global login
269
+ api = get_app_info()
270
+ if not api or len(api) < 2:
271
+ await message.reply('مشکل در API!')
272
+ return
273
+
274
+ login['id'] = int(api[1])
275
+ login['hash'] = api[0]
276
+ login['number'] = phone_number
277
+ login['api_data'] = {
278
+ 'api_id': api[1],
279
+ 'api_hash': api[0],
280
+ 'phone_number': phone_number,
281
+ 'session': phone_number,
282
+ '2fa_password': None
283
+ }
284
+
285
+ try:
286
+ login['client'] = Client(name=session_file.replace('.session', ''), api_id=login['id'], api_hash=login['hash'])
287
+ await login['client'].connect()
288
+ login['response'] = await login['client'].send_code(phone_number)
289
+ await message.reply(f'✅ کد تأیید به {phone_number} ارسال شد.\n`code 12345`')
290
+ except errors.BadRequest as e:
291
+ await message.reply(f'Bad request: {str(e)}')
292
+ except errors.FloodWait as e:
293
+ await message.reply(f'Flood wait: {e.value} sec')
294
+ except Exception as e:
295
+ await message.reply(f'Connection error: {str(e)}')
296
+ except Exception as e:
297
+ await message.reply(f'خطا: {str(e)}')
298
+
299
+
300
+ # ==========================
301
+ # تأیید کد ورود
302
+ # ==========================
303
+ async def set_code_cmd(message):
304
+ global login
305
+ parts = message.text.split(' ', 1)
306
+ if len(parts) < 2:
307
+ await message.reply('`code 12345`')
308
+ return
309
+ code = parts[1].strip()
310
+
311
+ try:
312
+ await login['client'].sign_in(login['number'], login['response'].phone_code_hash, code)
313
+ await login['client'].disconnect()
314
+ save_account_data(login['number'], login['api_data'])
315
+ await message.reply(f"✅ اکانت اضافه شد!\n├ شماره: {login['number']}")
316
+ login = {}
317
+ except errors.SessionPasswordNeeded:
318
+ await message.reply('🔒 لطفا رمز را با `pass your_password` بدهید')
319
+ except errors.BadRequest:
320
+ await message.reply('ورود با مشکل مواجه شد')
321
+ except Exception as e:
322
+ await message.reply(f'⚠️ خطا در ورود: {e}')
323
+
324
+
325
+ # ==========================
326
+ # افزودن رمز دومرحله‌ای
327
+ # ==========================
328
+ async def set_2fa_cmd(message):
329
+ global login
330
+ parts = message.text.split(' ', 1)
331
+ if len(parts) < 2:
332
+ await message.reply('`pass my_password`')
333
+ return
334
+ password = parts[1].strip()
335
+ try:
336
+ await login['client'].check_password(password)
337
+ login['api_data']['2fa_password'] = password
338
+ save_account_data(login['number'], login['api_data'])
339
+ await message.reply(f"✅ اکانت با موفقیت اضافه شد!\n├ شماره: {login['number']}")
340
+ await login['client'].disconnect()
341
+ login = {}
342
+ except errors.BadRequest:
343
+ await message.reply('رمز اشتباه است!')
344
+ except Exception as e:
345
+ await message.reply(f'⚠️ خطا در ثبت پسورد: {e}')
346
+
347
+
348
+ # ==========================
349
+ # حذف یک اکانت خاص
350
+ # ==========================
351
+ def remove_client_from_pool(phone_number: str):
352
+ cli = client_pool.get(phone_number)
353
+ if cli:
354
+ try:
355
+ asyncio.create_task(cli.stop())
356
+ except:
357
+ pass
358
+ client_pool.pop(phone_number, None)
359
+ client_locks.pop(phone_number, None)
360
+
361
+
362
+ async def delete_account_cmd(message):
363
+ try:
364
+ phone_number = message.text.split()[1]
365
+ main_path = f'{ACCOUNTS_FOLDER}/{phone_number}.session'
366
+ remove_client_from_pool(phone_number)
367
+ if os.path.isfile(main_path):
368
+ os.unlink(main_path)
369
+ await message.reply('<b>Account deleted successfully.</b>')
370
+ else:
371
+ await message.reply('<b>Account not found in database.</b>')
372
+ except IndexError:
373
+ await message.reply('Please enter phone number')
374
+ except Exception as e:
375
+ await message.reply(f'<b>Error deleting account: {str(e)}</b>')
376
+
377
+
378
+ # ==========================
379
+ # حذف تمام اکانت‌ها
380
+ # ==========================
381
+ async def delete_all_accounts_cmd(message):
382
+ try:
383
+ accountss = accounts()
384
+ count = len(accountss)
385
+ await stop_all_clients()
386
+ for session in accountss:
387
+ main_path = f'{ACCOUNTS_FOLDER}/{session}.session'
388
+ try:
389
+ os.unlink(main_path)
390
+ except Exception:
391
+ pass
392
+ await message.reply(f'<b>{count} accounts deleted.</b>')
393
+ except Exception as e:
394
+ await message.reply(f'<b>Error deleting all accounts: {str(e)}</b>')
@@ -5,7 +5,7 @@ with open("README.md", encoding="utf-8") as f:
5
5
 
6
6
  setup(
7
7
  name="CliRemote",
8
- version="1.7.0",
8
+ version="1.7.2",
9
9
  author="MrAhmadiRad",
10
10
  author_email="mohammadahmadirad69@gmail.com",
11
11
  description="A precise, async-safe, Telegram automation core (Python 3.8+)",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes