CliRemote 1.7.3__py3-none-any.whl → 1.7.4__py3-none-any.whl
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.
- {cliremote-1.7.3.dist-info → cliremote-1.7.4.dist-info}/METADATA +1 -1
- {cliremote-1.7.3.dist-info → cliremote-1.7.4.dist-info}/RECORD +6 -6
- remote/getcode_controller.py +16 -10
- {cliremote-1.7.3.dist-info → cliremote-1.7.4.dist-info}/WHEEL +0 -0
- {cliremote-1.7.3.dist-info → cliremote-1.7.4.dist-info}/licenses/LICENSE +0 -0
- {cliremote-1.7.3.dist-info → cliremote-1.7.4.dist-info}/top_level.txt +0 -0
@@ -1,4 +1,4 @@
|
|
1
|
-
cliremote-1.7.
|
1
|
+
cliremote-1.7.4.dist-info/licenses/LICENSE,sha256=O-0zMbcEi6wXz1DiSdVgzMlQjJcNqNe5KDv08uYzqR0,1055
|
2
2
|
remote/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
3
3
|
remote/account_manager.py,sha256=TepnGIoE2hU-j_NmU5ByoS-JrboE0w3A1bYmQoQX5h8,15176
|
4
4
|
remote/account_viewer.py,sha256=MQoH5lOz24651EjhlzVwi6O5hVUAT7Q5fFU6ZHjBlsM,4243
|
@@ -13,7 +13,7 @@ remote/client_picker.py,sha256=6WDIabYhcXSwcCAuRUfJfh6V1ZXP2EiFdAnutK2qLTk,139
|
|
13
13
|
remote/config.py,sha256=VK0e96gEINRViKIq99CYYuYyaVZTLtlWlPKKkBd41Cg,2377
|
14
14
|
remote/device_manager.py,sha256=SUCONe1qa5jMHOMqqS27ATtv3CaqAT8cN9jNi7AI_Go,5813
|
15
15
|
remote/file_sender.py,sha256=5_3ptTkoFejhJhaSyzh-8y5l_k7frxFq9LS_WL5jsGc,3657
|
16
|
-
remote/getcode_controller.py,sha256=
|
16
|
+
remote/getcode_controller.py,sha256=Rz7Butx6YWj3vJvnOBOPIx7C6KwGe0l8lloGaa-e9VE,2191
|
17
17
|
remote/health.py,sha256=JVCxw8iB46PO4cQtoXP9CbwuSHZ3vEAVvdb_C8Uc7R4,1294
|
18
18
|
remote/help_menu.py,sha256=onOmE8-MZmxaY2Sl_Ecgji0Axn2HeNJQFKY34udLfyw,228
|
19
19
|
remote/init.py,sha256=hpJILTMikI5ZXVDdIPmDENQAgZB8R6sYjLk5Jvn-zp4,398
|
@@ -33,7 +33,7 @@ remote/text_manager.py,sha256=C2wNSXPSCDu8NSD3RsfbKmUQMWOYd1B5N4tzy-Jsriw,2195
|
|
33
33
|
remote/username_manager.py,sha256=nMNdke-2FIv86xR1Y6rR-43oUoQu_3Khw8wEo54noXI,3388
|
34
34
|
remote/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
35
35
|
remote/utils/sqlite_utils.py,sha256=5i0oUXsBgKC_8qHZPJ-Gyhp9D1TwqKHVvuZRIhKpS6w,1260
|
36
|
-
cliremote-1.7.
|
37
|
-
cliremote-1.7.
|
38
|
-
cliremote-1.7.
|
39
|
-
cliremote-1.7.
|
36
|
+
cliremote-1.7.4.dist-info/METADATA,sha256=eDRGWBlYisBp4NAddCpwcb2vRhR4Fu8khxv57uSyWPY,1202
|
37
|
+
cliremote-1.7.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
38
|
+
cliremote-1.7.4.dist-info/top_level.txt,sha256=yBZidJ6zCix_a2ubGlYaewvlzBFXWbckQt20dudxJ1E,7
|
39
|
+
cliremote-1.7.4.dist-info/RECORD,,
|
remote/getcode_controller.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# antispam_core/getcode_controller.py
|
2
2
|
import os, logging
|
3
3
|
from pyrogram import Client
|
4
|
+
from .client_manager import get_active_accounts, get_or_start_client
|
4
5
|
logger = logging.getLogger(__name__)
|
5
6
|
|
6
7
|
async def handle_getcode_cmd(message, get_app_info):
|
@@ -13,23 +14,28 @@ async def handle_getcode_cmd(message, get_app_info):
|
|
13
14
|
if len(parts) < 2:
|
14
15
|
await message.reply('لطفا شماره را وارد کنید\nمثال: gcode +989123456789')
|
15
16
|
return
|
16
|
-
|
17
|
+
accs = list(get_active_accounts())
|
17
18
|
number = parts[1]
|
18
19
|
session_path = f'acc/{number}.session'
|
19
20
|
if not os.path.exists(session_path):
|
20
21
|
await message.reply('<b>شماره مورد نظر وجود ندارد.</b>')
|
21
22
|
return
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
23
|
+
for phone in accs:
|
24
|
+
if phone == number:
|
25
|
+
try:
|
26
|
+
cli = await get_or_start_client(phone)
|
27
|
+
if cli and getattr(cli, "is_connected", False):
|
28
|
+
logger.info("get_any_client: started %s", phone)
|
29
|
+
return cli
|
30
|
+
except Exception as e:
|
31
|
+
logger.warning("get_any_client: failed start %s: %s: %s", phone, type(e).__name__, e)
|
32
|
+
break
|
33
|
+
else:
|
34
|
+
logger.info(f"{phone}")
|
35
|
+
|
30
36
|
|
31
37
|
try:
|
32
|
-
async with
|
38
|
+
async with cli:
|
33
39
|
messages = [msg async for msg in cli.get_chat_history(777000, limit=1)]
|
34
40
|
if messages and messages[0].text:
|
35
41
|
await message.reply(messages[0].text)
|
File without changes
|
File without changes
|
File without changes
|