Rubka 7.1.8__tar.gz → 7.1.9__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.
- {rubka-7.1.8 → rubka-7.1.9}/PKG-INFO +1 -2
- {rubka-7.1.8 → rubka-7.1.9}/Rubka.egg-info/PKG-INFO +1 -2
- {rubka-7.1.8 → rubka-7.1.9}/Rubka.egg-info/requires.txt +0 -1
- {rubka-7.1.8 → rubka-7.1.9}/rubka/context.py +76 -4
- {rubka-7.1.8 → rubka-7.1.9}/setup.py +1 -2
- {rubka-7.1.8 → rubka-7.1.9}/README.md +0 -0
- {rubka-7.1.8 → rubka-7.1.9}/Rubka.egg-info/SOURCES.txt +0 -0
- {rubka-7.1.8 → rubka-7.1.9}/Rubka.egg-info/dependency_links.txt +0 -0
- {rubka-7.1.8 → rubka-7.1.9}/Rubka.egg-info/entry_points.txt +0 -0
- {rubka-7.1.8 → rubka-7.1.9}/Rubka.egg-info/not-zip-safe +0 -0
- {rubka-7.1.8 → rubka-7.1.9}/Rubka.egg-info/top_level.txt +0 -0
- {rubka-7.1.8 → rubka-7.1.9}/rubka/__init__.py +0 -0
- {rubka-7.1.8 → rubka-7.1.9}/rubka/adaptorrubka/__init__.py +0 -0
- {rubka-7.1.8 → rubka-7.1.9}/rubka/adaptorrubka/client/__init__.py +0 -0
- {rubka-7.1.8 → rubka-7.1.9}/rubka/adaptorrubka/client/client.py +0 -0
- {rubka-7.1.8 → rubka-7.1.9}/rubka/adaptorrubka/crypto/__init__.py +0 -0
- {rubka-7.1.8 → rubka-7.1.9}/rubka/adaptorrubka/crypto/crypto.py +0 -0
- {rubka-7.1.8 → rubka-7.1.9}/rubka/adaptorrubka/enums.py +0 -0
- {rubka-7.1.8 → rubka-7.1.9}/rubka/adaptorrubka/exceptions.py +0 -0
- {rubka-7.1.8 → rubka-7.1.9}/rubka/adaptorrubka/methods/__init__.py +0 -0
- {rubka-7.1.8 → rubka-7.1.9}/rubka/adaptorrubka/methods/methods.py +0 -0
- {rubka-7.1.8 → rubka-7.1.9}/rubka/adaptorrubka/network/__init__.py +0 -0
- {rubka-7.1.8 → rubka-7.1.9}/rubka/adaptorrubka/network/helper.py +0 -0
- {rubka-7.1.8 → rubka-7.1.9}/rubka/adaptorrubka/network/network.py +0 -0
- {rubka-7.1.8 → rubka-7.1.9}/rubka/adaptorrubka/network/socket.py +0 -0
- {rubka-7.1.8 → rubka-7.1.9}/rubka/adaptorrubka/sessions/__init__.py +0 -0
- {rubka-7.1.8 → rubka-7.1.9}/rubka/adaptorrubka/sessions/sessions.py +0 -0
- {rubka-7.1.8 → rubka-7.1.9}/rubka/adaptorrubka/types/__init__.py +0 -0
- {rubka-7.1.8 → rubka-7.1.9}/rubka/adaptorrubka/types/socket/__init__.py +0 -0
- {rubka-7.1.8 → rubka-7.1.9}/rubka/adaptorrubka/types/socket/message.py +0 -0
- {rubka-7.1.8 → rubka-7.1.9}/rubka/adaptorrubka/utils/__init__.py +0 -0
- {rubka-7.1.8 → rubka-7.1.9}/rubka/adaptorrubka/utils/configs.py +0 -0
- {rubka-7.1.8 → rubka-7.1.9}/rubka/adaptorrubka/utils/utils.py +0 -0
- {rubka-7.1.8 → rubka-7.1.9}/rubka/api.py +0 -0
- {rubka-7.1.8 → rubka-7.1.9}/rubka/asynco.py +0 -0
- {rubka-7.1.8 → rubka-7.1.9}/rubka/button.py +0 -0
- {rubka-7.1.8 → rubka-7.1.9}/rubka/config.py +0 -0
- {rubka-7.1.8 → rubka-7.1.9}/rubka/decorators.py +0 -0
- {rubka-7.1.8 → rubka-7.1.9}/rubka/exceptions.py +0 -0
- {rubka-7.1.8 → rubka-7.1.9}/rubka/filters.py +0 -0
- {rubka-7.1.8 → rubka-7.1.9}/rubka/helpers.py +0 -0
- {rubka-7.1.8 → rubka-7.1.9}/rubka/jobs.py +0 -0
- {rubka-7.1.8 → rubka-7.1.9}/rubka/keyboards.py +0 -0
- {rubka-7.1.8 → rubka-7.1.9}/rubka/keypad.py +0 -0
- {rubka-7.1.8 → rubka-7.1.9}/rubka/logger.py +0 -0
- {rubka-7.1.8 → rubka-7.1.9}/rubka/rubino.py +0 -0
- {rubka-7.1.8 → rubka-7.1.9}/rubka/tv.py +0 -0
- {rubka-7.1.8 → rubka-7.1.9}/rubka/update.py +0 -0
- {rubka-7.1.8 → rubka-7.1.9}/rubka/utils.py +0 -0
- {rubka-7.1.8 → rubka-7.1.9}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: Rubka
|
|
3
|
-
Version: 7.1.
|
|
3
|
+
Version: 7.1.9
|
|
4
4
|
Summary: Rubika: A Python library for interacting with the Rubika Bot API. This library provides an easy-to-use interface to send messages, polls, stickers, media files, manage groups and channels, handle inline keyboards, and implement advanced bot features like subscription management, user authentication, and message handling. Ideal for developers looking to automate and extend their Rubika bots with Python.
|
|
5
5
|
Home-page: https://github.com/Mahdy-Ahmadi/Rubka
|
|
6
6
|
Download-URL: https://github.com/Mahdy-Ahmadi/rubka/archive/refs/tags/v6.6.4.zip
|
|
@@ -27,7 +27,6 @@ Classifier: Natural Language :: Persian
|
|
|
27
27
|
Requires-Python: >=3.6
|
|
28
28
|
Description-Content-Type: text/markdown
|
|
29
29
|
Requires-Dist: requests
|
|
30
|
-
Requires-Dist: Pillow
|
|
31
30
|
Requires-Dist: websocket-client
|
|
32
31
|
Requires-Dist: pycryptodome
|
|
33
32
|
Requires-Dist: aiohttp
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: Rubka
|
|
3
|
-
Version: 7.1.
|
|
3
|
+
Version: 7.1.9
|
|
4
4
|
Summary: Rubika: A Python library for interacting with the Rubika Bot API. This library provides an easy-to-use interface to send messages, polls, stickers, media files, manage groups and channels, handle inline keyboards, and implement advanced bot features like subscription management, user authentication, and message handling. Ideal for developers looking to automate and extend their Rubika bots with Python.
|
|
5
5
|
Home-page: https://github.com/Mahdy-Ahmadi/Rubka
|
|
6
6
|
Download-URL: https://github.com/Mahdy-Ahmadi/rubka/archive/refs/tags/v6.6.4.zip
|
|
@@ -27,7 +27,6 @@ Classifier: Natural Language :: Persian
|
|
|
27
27
|
Requires-Python: >=3.6
|
|
28
28
|
Description-Content-Type: text/markdown
|
|
29
29
|
Requires-Dist: requests
|
|
30
|
-
Requires-Dist: Pillow
|
|
31
30
|
Requires-Dist: websocket-client
|
|
32
31
|
Requires-Dist: pycryptodome
|
|
33
32
|
Requires-Dist: aiohttp
|
|
@@ -3,6 +3,66 @@ from pathlib import Path
|
|
|
3
3
|
from typing import List, Optional, Dict, Any, Literal, Callable, Union,Set
|
|
4
4
|
import re,inspect
|
|
5
5
|
import asyncio
|
|
6
|
+
_EMOJI_PATTERN = re.compile(
|
|
7
|
+
"["
|
|
8
|
+
"\U0001F300-\U0001F5FF"
|
|
9
|
+
"\U0001F600-\U0001F64F"
|
|
10
|
+
"\U0001F680-\U0001F6FF"
|
|
11
|
+
"\U0001F700-\U0001F77F"
|
|
12
|
+
"\U0001F780-\U0001F7FF"
|
|
13
|
+
"\U0001F800-\U0001F8FF"
|
|
14
|
+
"\U0001F900-\U0001F9FF"
|
|
15
|
+
"\U0001FA00-\U0001FA6F"
|
|
16
|
+
"\U0001FA70-\U0001FAFF"
|
|
17
|
+
"\U00002700-\U000027BF"
|
|
18
|
+
"\U00002600-\U000026FF"
|
|
19
|
+
"\U00002000-\U000023FF"
|
|
20
|
+
"]+",
|
|
21
|
+
flags=re.UNICODE
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
def contains_emoji(text: str) -> bool:
|
|
25
|
+
if not text:return False
|
|
26
|
+
return bool(_EMOJI_PATTERN.search(text))
|
|
27
|
+
|
|
28
|
+
def count_emojis(text: str) -> int:
|
|
29
|
+
if not text:return 0
|
|
30
|
+
return len(_EMOJI_PATTERN.findall(text))
|
|
31
|
+
def contains_link_or_mention(text: str) -> bool:
|
|
32
|
+
if not text:return False
|
|
33
|
+
pattern = re.compile(
|
|
34
|
+
r"(?i)\b("
|
|
35
|
+
r"https?://[^\s]+"
|
|
36
|
+
r"|www\.[^\s]+"
|
|
37
|
+
r"|[a-zA-Z0-9.-]+\.(com|net|org|ir|edu|gov|info|biz|io|me|co|xyz|in|us|uk|ru|tv|cc|app|dev|site|store|cloud|shop)"
|
|
38
|
+
r"|t\.me/[^\s]+"
|
|
39
|
+
r"|telegram\.me/[^\s]+"
|
|
40
|
+
r"|rubika\.(ir|app)/[^\s]+"
|
|
41
|
+
r"|whatsapp\.com/[^\s]+"
|
|
42
|
+
r"|wa\.me/[^\s]+"
|
|
43
|
+
r"|instagram\.com/[^\s]+"
|
|
44
|
+
r"|instagr\.am/[^\s]+"
|
|
45
|
+
r"|youtube\.com/[^\s]+"
|
|
46
|
+
r"|youtu\.be/[^\s]+"
|
|
47
|
+
r"|aparat\.com/[^\s]+"
|
|
48
|
+
r"|discord\.gg/[^\s]+"
|
|
49
|
+
r"|discord\.com/[^\s]+"
|
|
50
|
+
r"|splus\.ir/[^\s]+"
|
|
51
|
+
r"|eitaa\.com/[^\s]+"
|
|
52
|
+
r"|ble\.ir/[^\s]+"
|
|
53
|
+
r"|gap\.im/[^\s]+"
|
|
54
|
+
r"|rubino\.ir/[^\s]+"
|
|
55
|
+
r"|pin\.it/[^\s]+"
|
|
56
|
+
r"|twitter\.com/[^\s]+"
|
|
57
|
+
r"|x\.com/[^\s]+"
|
|
58
|
+
r"|facebook\.com/[^\s]+"
|
|
59
|
+
r"|threads\.net/[^\s]+"
|
|
60
|
+
r"|@\w+"
|
|
61
|
+
r"|\b\d{1,3}(?:\.\d{1,3}){3}\b"
|
|
62
|
+
r"|\[?[A-F0-9:]{2,39}\]?"
|
|
63
|
+
r")\b"
|
|
64
|
+
)
|
|
65
|
+
return bool(pattern.search(text))
|
|
6
66
|
class File:
|
|
7
67
|
def __init__(self, data: dict):
|
|
8
68
|
self.file_id: str = data.get("file_id")
|
|
@@ -215,10 +275,22 @@ class Message:
|
|
|
215
275
|
self.author_guid = self.raw_data.get("sender_id", sender_id)
|
|
216
276
|
self.message_id: str = self.raw_data.get("message_id", message_id)
|
|
217
277
|
self.text: str = self.raw_data.get("text", text)
|
|
218
|
-
self.has_link =
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
))
|
|
278
|
+
self.has_link = contains_link_or_mention(self.raw_data.get("text", text))
|
|
279
|
+
self.is_link = self.has_link
|
|
280
|
+
self.is_mention = bool(re.search(r"@\w+", self.raw_data.get("text", text) or ""))
|
|
281
|
+
self.is_hashtag = bool(re.search(r"#\w+", text or ""))
|
|
282
|
+
self.is_number = bool(re.search(r"\d+", text or ""))
|
|
283
|
+
self.is_emoji = contains_emoji(self.raw_data.get("text", text))
|
|
284
|
+
self.emoji_count = count_emojis(self.raw_data.get("text", text))
|
|
285
|
+
self.is_pure_emoji = bool(self.is_emoji and self.emoji_count == len(self.text))
|
|
286
|
+
self.is_photo = None
|
|
287
|
+
self.is_video = None
|
|
288
|
+
self.is_audio = None
|
|
289
|
+
self.is_voice = None
|
|
290
|
+
self.is_document = None
|
|
291
|
+
self.is_archive = None
|
|
292
|
+
self.is_executable = None
|
|
293
|
+
self.is_font = None
|
|
222
294
|
self.sender_id: str = self.raw_data.get("sender_id", sender_id)
|
|
223
295
|
self.time: str = self.raw_data.get("time")
|
|
224
296
|
self.is_edited: bool = self.raw_data.get("is_edited", False)
|
|
@@ -13,7 +13,7 @@ with open("README.md", "r", encoding="utf-8") as f:
|
|
|
13
13
|
|
|
14
14
|
setup(
|
|
15
15
|
name='Rubka',
|
|
16
|
-
version='7.1.
|
|
16
|
+
version='7.1.9',
|
|
17
17
|
description=(
|
|
18
18
|
"Rubika: A Python library for interacting with the Rubika Bot API. "
|
|
19
19
|
"This library provides an easy-to-use interface to send messages, polls, "
|
|
@@ -49,7 +49,6 @@ setup(
|
|
|
49
49
|
python_requires='>=3.6',
|
|
50
50
|
install_requires=[
|
|
51
51
|
"requests",
|
|
52
|
-
"Pillow",
|
|
53
52
|
"websocket-client",
|
|
54
53
|
'pycryptodome',
|
|
55
54
|
'aiohttp',
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|