CliRemote 1.7.9__tar.gz → 1.7.12__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.
- {cliremote-1.7.9 → cliremote-1.7.12}/CliRemote.egg-info/PKG-INFO +1 -1
- {cliremote-1.7.9 → cliremote-1.7.12}/PKG-INFO +1 -1
- {cliremote-1.7.9 → cliremote-1.7.12}/pyproject.toml +1 -1
- {cliremote-1.7.9 → cliremote-1.7.12}/remote/admin_manager.py +32 -24
- {cliremote-1.7.9 → cliremote-1.7.12}/setup.py +1 -1
- {cliremote-1.7.9 → cliremote-1.7.12}/CliRemote.egg-info/SOURCES.txt +0 -0
- {cliremote-1.7.9 → cliremote-1.7.12}/CliRemote.egg-info/dependency_links.txt +0 -0
- {cliremote-1.7.9 → cliremote-1.7.12}/CliRemote.egg-info/requires.txt +0 -0
- {cliremote-1.7.9 → cliremote-1.7.12}/CliRemote.egg-info/top_level.txt +0 -0
- {cliremote-1.7.9 → cliremote-1.7.12}/LICENSE +0 -0
- {cliremote-1.7.9 → cliremote-1.7.12}/MANIFEST.in +0 -0
- {cliremote-1.7.9 → cliremote-1.7.12}/README.md +0 -0
- {cliremote-1.7.9 → cliremote-1.7.12}/remote/__init__.py +0 -0
- {cliremote-1.7.9 → cliremote-1.7.12}/remote/account_manager.py +0 -0
- {cliremote-1.7.9 → cliremote-1.7.12}/remote/account_viewer.py +0 -0
- {cliremote-1.7.9 → cliremote-1.7.12}/remote/analytics_manager.py +0 -0
- {cliremote-1.7.9 → cliremote-1.7.12}/remote/batch_manager.py +0 -0
- {cliremote-1.7.9 → cliremote-1.7.12}/remote/block_manager.py +0 -0
- {cliremote-1.7.9 → cliremote-1.7.12}/remote/caption_manager.py +0 -0
- {cliremote-1.7.9 → cliremote-1.7.12}/remote/cleaner.py +0 -0
- {cliremote-1.7.9 → cliremote-1.7.12}/remote/client_manager.py +0 -0
- {cliremote-1.7.9 → cliremote-1.7.12}/remote/client_picker.py +0 -0
- {cliremote-1.7.9 → cliremote-1.7.12}/remote/config.py +0 -0
- {cliremote-1.7.9 → cliremote-1.7.12}/remote/device_manager.py +0 -0
- {cliremote-1.7.9 → cliremote-1.7.12}/remote/file_sender.py +0 -0
- {cliremote-1.7.9 → cliremote-1.7.12}/remote/getcode_controller.py +0 -0
- {cliremote-1.7.9 → cliremote-1.7.12}/remote/health.py +0 -0
- {cliremote-1.7.9 → cliremote-1.7.12}/remote/help_menu.py +0 -0
- {cliremote-1.7.9 → cliremote-1.7.12}/remote/init.py +0 -0
- {cliremote-1.7.9 → cliremote-1.7.12}/remote/join_controller.py +0 -0
- {cliremote-1.7.9 → cliremote-1.7.12}/remote/joiner.py +0 -0
- {cliremote-1.7.9 → cliremote-1.7.12}/remote/leave_controller.py +0 -0
- {cliremote-1.7.9 → cliremote-1.7.12}/remote/lefter.py +0 -0
- {cliremote-1.7.9 → cliremote-1.7.12}/remote/mention_manager.py +0 -0
- {cliremote-1.7.9 → cliremote-1.7.12}/remote/precise_engine.py +0 -0
- {cliremote-1.7.9 → cliremote-1.7.12}/remote/profile_info.py +0 -0
- {cliremote-1.7.9 → cliremote-1.7.12}/remote/profile_media.py +0 -0
- {cliremote-1.7.9 → cliremote-1.7.12}/remote/profile_privacy.py +0 -0
- {cliremote-1.7.9 → cliremote-1.7.12}/remote/spammer.py +0 -0
- {cliremote-1.7.9 → cliremote-1.7.12}/remote/speed_manager.py +0 -0
- {cliremote-1.7.9 → cliremote-1.7.12}/remote/stop_manager.py +0 -0
- {cliremote-1.7.9 → cliremote-1.7.12}/remote/text_manager.py +0 -0
- {cliremote-1.7.9 → cliremote-1.7.12}/remote/username_manager.py +0 -0
- {cliremote-1.7.9 → cliremote-1.7.12}/remote/utils/__init__.py +0 -0
- {cliremote-1.7.9 → cliremote-1.7.12}/remote/utils/sqlite_utils.py +0 -0
- {cliremote-1.7.9 → cliremote-1.7.12}/setup.cfg +0 -0
@@ -5,15 +5,15 @@ from .config import OWNER_ID
|
|
5
5
|
|
6
6
|
logger = logging.getLogger(__name__)
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
ADMINS_FILE = os.path.join(BASE_DIR, "admins.json")
|
8
|
+
ADMINS_FILE = "admins.json"
|
9
|
+
|
11
10
|
|
12
11
|
def load_admins() -> list[int]:
|
13
12
|
"""
|
14
|
-
بارگذاری لیست ادمینها از
|
13
|
+
بارگذاری لیست ادمینها از فایل.
|
14
|
+
همیشه OWNER_ID را هم به لیست اضافه میکند.
|
15
15
|
"""
|
16
|
-
s = set(OWNER_ID)
|
16
|
+
s = set(OWNER_ID)
|
17
17
|
try:
|
18
18
|
if os.path.exists(ADMINS_FILE):
|
19
19
|
with open(ADMINS_FILE, "r", encoding="utf-8") as f:
|
@@ -22,38 +22,46 @@ def load_admins() -> list[int]:
|
|
22
22
|
for v in data:
|
23
23
|
try:
|
24
24
|
s.add(int(v))
|
25
|
-
except
|
26
|
-
|
25
|
+
except:
|
26
|
+
pass
|
27
27
|
except Exception as e:
|
28
28
|
logger.warning(f"Error loading admins: {e}")
|
29
29
|
return list(s)
|
30
30
|
|
31
|
+
|
31
32
|
def save_admins():
|
32
|
-
"""
|
33
|
+
"""
|
34
|
+
ذخیرهی ادمینها در فایل.
|
35
|
+
"""
|
33
36
|
try:
|
34
37
|
with open(ADMINS_FILE, "w", encoding="utf-8") as f:
|
35
38
|
json.dump(list(ADMINS), f, ensure_ascii=False, indent=2)
|
36
39
|
except Exception as e:
|
37
40
|
logger.error(f"Error saving admins: {e}")
|
38
41
|
|
42
|
+
|
39
43
|
ADMINS = load_admins()
|
40
44
|
|
41
|
-
#
|
45
|
+
# فیلترهای دسترسی برای Pyrogram
|
42
46
|
admin_filter = filters.create(
|
43
|
-
lambda _, __, m: bool(getattr(m, "from_user", None))
|
47
|
+
lambda _, __, m: bool(getattr(m, "from_user", None))
|
48
|
+
and int(m.from_user.id) in ADMINS
|
44
49
|
)
|
45
50
|
owner_filter = filters.create(
|
46
|
-
lambda _, __, m: bool(getattr(m, "from_user", None))
|
51
|
+
lambda _, __, m: bool(getattr(m, "from_user", None))
|
52
|
+
and int(m.from_user.id) in OWNER_ID
|
47
53
|
)
|
48
54
|
|
55
|
+
|
49
56
|
# =============================
|
50
57
|
# فرمانهای مدیریتی
|
51
58
|
# =============================
|
59
|
+
|
52
60
|
async def add_admin_cmd(message):
|
53
61
|
try:
|
54
|
-
parts =
|
62
|
+
parts = message.text.split()
|
55
63
|
if len(parts) < 2:
|
56
|
-
await message.reply("مثال:
|
64
|
+
await message.reply("مثال: addadmin 123456789")
|
57
65
|
return
|
58
66
|
uid = int(parts[1])
|
59
67
|
if uid in OWNER_ID:
|
@@ -62,19 +70,19 @@ async def add_admin_cmd(message):
|
|
62
70
|
if uid not in ADMINS:
|
63
71
|
ADMINS.append(uid)
|
64
72
|
save_admins()
|
65
|
-
await message.reply(f"ادمین جدید اضافه شد:
|
66
|
-
logger.info(f"Admin added: {uid}")
|
73
|
+
await message.reply(f"ادمین جدید اضافه شد: {uid}")
|
67
74
|
else:
|
68
75
|
await message.reply("قبلاً ادمین بود")
|
69
76
|
except Exception as e:
|
70
|
-
logger.error(f"add_admin_cmd error: {e}"
|
77
|
+
logger.error(f"add_admin_cmd error: {e}")
|
71
78
|
await message.reply(f"خطا: {e}")
|
72
79
|
|
80
|
+
|
73
81
|
async def del_admin_cmd(message):
|
74
82
|
try:
|
75
|
-
parts =
|
83
|
+
parts = message.text.split()
|
76
84
|
if len(parts) < 2:
|
77
|
-
await message.reply("مثال:
|
85
|
+
await message.reply("مثال: deladmin 123456789")
|
78
86
|
return
|
79
87
|
uid = int(parts[1])
|
80
88
|
if uid in OWNER_ID:
|
@@ -83,21 +91,21 @@ async def del_admin_cmd(message):
|
|
83
91
|
if uid in ADMINS:
|
84
92
|
ADMINS.remove(uid)
|
85
93
|
save_admins()
|
86
|
-
await message.reply(f"ادمین حذف شد:
|
87
|
-
logger.info(f"Admin removed: {uid}")
|
94
|
+
await message.reply(f"ادمین حذف شد: {uid}")
|
88
95
|
else:
|
89
96
|
await message.reply("کاربر ادمین نیست")
|
90
97
|
except Exception as e:
|
91
|
-
logger.error(f"del_admin_cmd error: {e}"
|
98
|
+
logger.error(f"del_admin_cmd error: {e}")
|
92
99
|
await message.reply(f"خطا: {e}")
|
93
100
|
|
101
|
+
|
94
102
|
async def list_admins_cmd(message):
|
95
103
|
try:
|
96
104
|
if not ADMINS:
|
97
105
|
await message.reply("لیست ادمینها خالی است.")
|
98
106
|
return
|
99
|
-
text = "👑 <b>ADMINS:</b>\n" + "\n".join([
|
100
|
-
await message.reply(text
|
107
|
+
text = "👑 <b>ADMINS:</b>\n" + "\n".join([str(x) for x in ADMINS])
|
108
|
+
await message.reply(text)
|
101
109
|
except Exception as e:
|
102
|
-
logger.error(f"list_admins_cmd error: {e}"
|
110
|
+
logger.error(f"list_admins_cmd error: {e}")
|
103
111
|
await message.reply(f"خطا: {e}")
|
@@ -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.
|
8
|
+
version="1.7.12",
|
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
|
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
|
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
|
File without changes
|
File without changes
|