soroushkit 4.2.0__tar.gz → 4.3.0__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.
- {soroushkit-4.2.0/soroushkit.egg-info → soroushkit-4.3.0}/PKG-INFO +4 -3
- {soroushkit-4.2.0 → soroushkit-4.3.0}/README.md +3 -2
- {soroushkit-4.2.0 → soroushkit-4.3.0}/setup.py +1 -1
- {soroushkit-4.2.0 → soroushkit-4.3.0}/soroushkit/__init__.py +1 -1
- {soroushkit-4.2.0 → soroushkit-4.3.0}/soroushkit/client.py +26 -0
- {soroushkit-4.2.0 → soroushkit-4.3.0/soroushkit.egg-info}/PKG-INFO +4 -3
- {soroushkit-4.2.0 → soroushkit-4.3.0}/LICENSE +0 -0
- {soroushkit-4.2.0 → soroushkit-4.3.0}/MANIFEST.in +0 -0
- {soroushkit-4.2.0 → soroushkit-4.3.0}/requirements.txt +0 -0
- {soroushkit-4.2.0 → soroushkit-4.3.0}/rouba_backup/__init__.py +0 -0
- {soroushkit-4.2.0 → soroushkit-4.3.0}/rouba_backup/client.py +0 -0
- {soroushkit-4.2.0 → soroushkit-4.3.0}/rouba_backup/client_backup.py +0 -0
- {soroushkit-4.2.0 → soroushkit-4.3.0}/rouba_backup/events.py +0 -0
- {soroushkit-4.2.0 → soroushkit-4.3.0}/setup.cfg +0 -0
- {soroushkit-4.2.0 → soroushkit-4.3.0}/sorocore/__init__.py +0 -0
- {soroushkit-4.2.0 → soroushkit-4.3.0}/sorocore/client.py +0 -0
- {soroushkit-4.2.0 → soroushkit-4.3.0}/sorocore/events.py +0 -0
- {soroushkit-4.2.0 → soroushkit-4.3.0}/soroushkit/events.py +0 -0
- {soroushkit-4.2.0 → soroushkit-4.3.0}/soroushkit.egg-info/SOURCES.txt +0 -0
- {soroushkit-4.2.0 → soroushkit-4.3.0}/soroushkit.egg-info/dependency_links.txt +0 -0
- {soroushkit-4.2.0 → soroushkit-4.3.0}/soroushkit.egg-info/requires.txt +0 -0
- {soroushkit-4.2.0 → soroushkit-4.3.0}/soroushkit.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: soroushkit
|
|
3
|
-
Version: 4.
|
|
3
|
+
Version: 4.3.0
|
|
4
4
|
Summary: Soroush Kit - Complete toolkit for Soroush Plus
|
|
5
5
|
Author: Arsha
|
|
6
6
|
Author-email: soroushkit@gmail.com
|
|
@@ -21,7 +21,7 @@ Dynamic: requires-dist
|
|
|
21
21
|
Dynamic: requires-python
|
|
22
22
|
Dynamic: summary
|
|
23
23
|
|
|
24
|
-
# SoroushKit v4.
|
|
24
|
+
# SoroushKit v4.3.0
|
|
25
25
|
|
|
26
26
|
**Complete toolkit for Soroush Plus**
|
|
27
27
|
|
|
@@ -29,7 +29,7 @@ Dynamic: summary
|
|
|
29
29
|
- High speed with poll_interval = 0.00001
|
|
30
30
|
- No API Key required
|
|
31
31
|
- Smart caching
|
|
32
|
-
- Group management: ban, mute, pin, unpin
|
|
32
|
+
- Group management: ban, mute, pin, unpin, leave_chat
|
|
33
33
|
- Message methods: delete, edit, reply
|
|
34
34
|
- User info: get_user_name, get_user_info
|
|
35
35
|
|
|
@@ -64,6 +64,7 @@ if __name__ == "__main__":
|
|
|
64
64
|
- `unmute_user(chat_id, user_id)` - Unmute a user
|
|
65
65
|
- `pin_message(chat_id, message_id)` - Pin a message
|
|
66
66
|
- `unpin_message(chat_id, message_id)` - Unpin a message
|
|
67
|
+
- `leave_chat(chat_id)` - Leave a chat or channel
|
|
67
68
|
|
|
68
69
|
## User Info Methods
|
|
69
70
|
- `get_user_name(user_id)` - Get user name
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# SoroushKit v4.
|
|
1
|
+
# SoroushKit v4.3.0
|
|
2
2
|
|
|
3
3
|
**Complete toolkit for Soroush Plus**
|
|
4
4
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
- High speed with poll_interval = 0.00001
|
|
7
7
|
- No API Key required
|
|
8
8
|
- Smart caching
|
|
9
|
-
- Group management: ban, mute, pin, unpin
|
|
9
|
+
- Group management: ban, mute, pin, unpin, leave_chat
|
|
10
10
|
- Message methods: delete, edit, reply
|
|
11
11
|
- User info: get_user_name, get_user_info
|
|
12
12
|
|
|
@@ -41,6 +41,7 @@ if __name__ == "__main__":
|
|
|
41
41
|
- `unmute_user(chat_id, user_id)` - Unmute a user
|
|
42
42
|
- `pin_message(chat_id, message_id)` - Pin a message
|
|
43
43
|
- `unpin_message(chat_id, message_id)` - Unpin a message
|
|
44
|
+
- `leave_chat(chat_id)` - Leave a chat or channel
|
|
44
45
|
|
|
45
46
|
## User Info Methods
|
|
46
47
|
- `get_user_name(user_id)` - Get user name
|
|
@@ -82,6 +82,8 @@ class SoroushKitClient:
|
|
|
82
82
|
except:
|
|
83
83
|
pass
|
|
84
84
|
|
|
85
|
+
# ========== مدیریت گروه ==========
|
|
86
|
+
|
|
85
87
|
async def ban_user(self, chat_id, user_id):
|
|
86
88
|
try:
|
|
87
89
|
result = await self._client.edit_permissions(chat_id, user_id, send_messages=False, view_messages=False)
|
|
@@ -125,6 +127,24 @@ class SoroushKitClient:
|
|
|
125
127
|
print(f"❌ Unpin error: {e}")
|
|
126
128
|
return False
|
|
127
129
|
|
|
130
|
+
# ========== خروج از گروه (جدید) ==========
|
|
131
|
+
|
|
132
|
+
async def leave_chat(self, chat_id):
|
|
133
|
+
"""خروج از گروه یا کانال"""
|
|
134
|
+
try:
|
|
135
|
+
result = await self._client.delete_dialog(chat_id)
|
|
136
|
+
return result
|
|
137
|
+
except Exception as e:
|
|
138
|
+
print(f"❌ Leave chat error: {e}")
|
|
139
|
+
try:
|
|
140
|
+
result = await self._client.leave_chat(chat_id)
|
|
141
|
+
return result
|
|
142
|
+
except Exception as e2:
|
|
143
|
+
print(f"❌ Leave chat error (alternative): {e2}")
|
|
144
|
+
return False
|
|
145
|
+
|
|
146
|
+
# ========== ویرایش و حذف ==========
|
|
147
|
+
|
|
128
148
|
async def edit_message(self, chat_id, message_id, text):
|
|
129
149
|
try:
|
|
130
150
|
from splusthon.tl.functions.messages import EditMessageRequest
|
|
@@ -155,6 +175,8 @@ class SoroushKitClient:
|
|
|
155
175
|
async def delete_message(self, chat_id, message_id, revoke=True):
|
|
156
176
|
return await self.delete_messages(chat_id, [message_id], revoke)
|
|
157
177
|
|
|
178
|
+
# ========== ارسال ==========
|
|
179
|
+
|
|
158
180
|
async def send_message(self, chat_id, text, reply_to=None):
|
|
159
181
|
try:
|
|
160
182
|
return await self._client.send_message(chat_id, text, reply_to=reply_to)
|
|
@@ -183,6 +205,8 @@ class SoroushKitClient:
|
|
|
183
205
|
print(f"❌ Send document error: {e}")
|
|
184
206
|
return None
|
|
185
207
|
|
|
208
|
+
# ========== دریافت ==========
|
|
209
|
+
|
|
186
210
|
async def get_me(self):
|
|
187
211
|
try:
|
|
188
212
|
return await self._client.get_me()
|
|
@@ -204,6 +228,8 @@ class SoroushKitClient:
|
|
|
204
228
|
print(f"❌ Get entity error: {e}")
|
|
205
229
|
return None
|
|
206
230
|
|
|
231
|
+
# ========== مدیریت کاربر ==========
|
|
232
|
+
|
|
207
233
|
async def get_user_name(self, user_id):
|
|
208
234
|
try:
|
|
209
235
|
user = await self.get_entity(user_id)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: soroushkit
|
|
3
|
-
Version: 4.
|
|
3
|
+
Version: 4.3.0
|
|
4
4
|
Summary: Soroush Kit - Complete toolkit for Soroush Plus
|
|
5
5
|
Author: Arsha
|
|
6
6
|
Author-email: soroushkit@gmail.com
|
|
@@ -21,7 +21,7 @@ Dynamic: requires-dist
|
|
|
21
21
|
Dynamic: requires-python
|
|
22
22
|
Dynamic: summary
|
|
23
23
|
|
|
24
|
-
# SoroushKit v4.
|
|
24
|
+
# SoroushKit v4.3.0
|
|
25
25
|
|
|
26
26
|
**Complete toolkit for Soroush Plus**
|
|
27
27
|
|
|
@@ -29,7 +29,7 @@ Dynamic: summary
|
|
|
29
29
|
- High speed with poll_interval = 0.00001
|
|
30
30
|
- No API Key required
|
|
31
31
|
- Smart caching
|
|
32
|
-
- Group management: ban, mute, pin, unpin
|
|
32
|
+
- Group management: ban, mute, pin, unpin, leave_chat
|
|
33
33
|
- Message methods: delete, edit, reply
|
|
34
34
|
- User info: get_user_name, get_user_info
|
|
35
35
|
|
|
@@ -64,6 +64,7 @@ if __name__ == "__main__":
|
|
|
64
64
|
- `unmute_user(chat_id, user_id)` - Unmute a user
|
|
65
65
|
- `pin_message(chat_id, message_id)` - Pin a message
|
|
66
66
|
- `unpin_message(chat_id, message_id)` - Unpin a message
|
|
67
|
+
- `leave_chat(chat_id)` - Leave a chat or channel
|
|
67
68
|
|
|
68
69
|
## User Info Methods
|
|
69
70
|
- `get_user_name(user_id)` - Get user name
|
|
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
|