RubigramClient 1.4.5__tar.gz → 1.4.7__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.
Potentially problematic release.
This version of RubigramClient might be problematic. Click here for more details.
- {rubigramclient-1.4.5 → rubigramclient-1.4.7}/PKG-INFO +1 -1
- {rubigramclient-1.4.5 → rubigramclient-1.4.7}/RubigramClient.egg-info/PKG-INFO +1 -1
- {rubigramclient-1.4.5 → rubigramclient-1.4.7}/pyproject.toml +1 -1
- {rubigramclient-1.4.5 → rubigramclient-1.4.7}/rubigram/client.py +0 -1
- {rubigramclient-1.4.5 → rubigramclient-1.4.7}/rubigram/filters.py +13 -0
- {rubigramclient-1.4.5 → rubigramclient-1.4.7}/rubigram/method.py +6 -1
- {rubigramclient-1.4.5 → rubigramclient-1.4.7}/rubigram/types.py +4 -4
- {rubigramclient-1.4.5 → rubigramclient-1.4.7}/LICENSE +0 -0
- {rubigramclient-1.4.5 → rubigramclient-1.4.7}/README.md +0 -0
- {rubigramclient-1.4.5 → rubigramclient-1.4.7}/RubigramClient.egg-info/SOURCES.txt +0 -0
- {rubigramclient-1.4.5 → rubigramclient-1.4.7}/RubigramClient.egg-info/dependency_links.txt +0 -0
- {rubigramclient-1.4.5 → rubigramclient-1.4.7}/RubigramClient.egg-info/requires.txt +0 -0
- {rubigramclient-1.4.5 → rubigramclient-1.4.7}/RubigramClient.egg-info/top_level.txt +0 -0
- {rubigramclient-1.4.5 → rubigramclient-1.4.7}/rubigram/__init__.py +0 -0
- {rubigramclient-1.4.5 → rubigramclient-1.4.7}/rubigram/network.py +0 -0
- {rubigramclient-1.4.5 → rubigramclient-1.4.7}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: RubigramClient
|
|
3
|
-
Version: 1.4.
|
|
3
|
+
Version: 1.4.7
|
|
4
4
|
Summary: A simple and flexible Python library for building advanced Rubika bots with powerful message handling, inline buttons, and custom filters.
|
|
5
5
|
Author-email: Javad RZ <Javad.Py1385@gmail.com>
|
|
6
6
|
Classifier: Programming Language :: Python :: 3
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: RubigramClient
|
|
3
|
-
Version: 1.4.
|
|
3
|
+
Version: 1.4.7
|
|
4
4
|
Summary: A simple and flexible Python library for building advanced Rubika bots with powerful message handling, inline buttons, and custom filters.
|
|
5
5
|
Author-email: Javad RZ <Javad.Py1385@gmail.com>
|
|
6
6
|
Classifier: Programming Language :: Python :: 3
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "RubigramClient"
|
|
3
|
-
version = "1.4.
|
|
3
|
+
version = "1.4.7"
|
|
4
4
|
description = "A simple and flexible Python library for building advanced Rubika bots with powerful message handling, inline buttons, and custom filters."
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.7"
|
|
@@ -149,11 +149,24 @@ def FORWARD_CHANNEL(update: Update):
|
|
|
149
149
|
return update.new_message.forwarded_from.type_from == "Channel"
|
|
150
150
|
return False
|
|
151
151
|
|
|
152
|
+
def GROUP(update: Update):
|
|
153
|
+
if isinstance(update, Update):
|
|
154
|
+
return update.chat_id.startswith("g0")
|
|
155
|
+
return False
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
def CHANNEL(update: Update):
|
|
159
|
+
if isinstance(update, Update):
|
|
160
|
+
return update.chat_id.startswith("c0")
|
|
161
|
+
return False
|
|
162
|
+
|
|
152
163
|
|
|
153
164
|
text = Filter(TEXT)
|
|
154
165
|
file = Filter(FILE)
|
|
155
166
|
live = Filter(LIVE)
|
|
156
167
|
poll = Filter(POLL)
|
|
168
|
+
group = Filter(GROUP)
|
|
169
|
+
channel = Filter(CHANNEL)
|
|
157
170
|
edited = Filter(EDITED)
|
|
158
171
|
contact = Filter(CONTACT)
|
|
159
172
|
sticker = Filter(STICKER)
|
|
@@ -71,6 +71,7 @@ class Method(Network):
|
|
|
71
71
|
"disable_notification": disable_notification,
|
|
72
72
|
"reply_to_message_id": reply_to_message_id
|
|
73
73
|
}
|
|
74
|
+
data = {key: value for key, value in data.items() if value is not None}
|
|
74
75
|
response = await self.request("sendMessage", data)
|
|
75
76
|
return MessageId.from_dict(response)
|
|
76
77
|
|
|
@@ -95,6 +96,7 @@ class Method(Network):
|
|
|
95
96
|
"reply_to_message_id": reply_to_message_id,
|
|
96
97
|
"chat_keypad_type": chat_keypad_type
|
|
97
98
|
}
|
|
99
|
+
data = {key: value for key, value in data.items() if value is not None}
|
|
98
100
|
response = await self.request("sendPoll", data)
|
|
99
101
|
return MessageId.from_dict(response)
|
|
100
102
|
|
|
@@ -119,6 +121,7 @@ class Method(Network):
|
|
|
119
121
|
"reply_to_message_id": reply_to_message_id,
|
|
120
122
|
"chat_keypad_type": chat_keypad_type
|
|
121
123
|
}
|
|
124
|
+
data = {key: value for key, value in data.items() if value is not None}
|
|
122
125
|
response = await self.request("sendLocation", data)
|
|
123
126
|
return MessageId.from_dict(response)
|
|
124
127
|
|
|
@@ -145,6 +148,7 @@ class Method(Network):
|
|
|
145
148
|
"reply_to_message_id": reply_to_message_id,
|
|
146
149
|
"chat_keypad_type": chat_keypad_type
|
|
147
150
|
}
|
|
151
|
+
data = {key: value for key, value in data.items() if value is not None}
|
|
148
152
|
response = await self.request("sendContact", data)
|
|
149
153
|
return MessageId.from_dict(response)
|
|
150
154
|
|
|
@@ -167,7 +171,7 @@ class Method(Network):
|
|
|
167
171
|
"reply_to_message_id": reply_to_message_id,
|
|
168
172
|
"chat_keypad_type": chat_keypad_type
|
|
169
173
|
}
|
|
170
|
-
|
|
174
|
+
data = {key: value for key, value in data.items() if value is not None}
|
|
171
175
|
response = await self.request("sendSticker", data)
|
|
172
176
|
return MessageId.from_dict(response)
|
|
173
177
|
|
|
@@ -208,6 +212,7 @@ class Method(Network):
|
|
|
208
212
|
"reply_to_message_id": reply_to_message_id,
|
|
209
213
|
"chat_keypad_type": chat_keypad_type,
|
|
210
214
|
}
|
|
215
|
+
data = {key: value for key, value in data.items() if value is not None}
|
|
211
216
|
response = await self.request("sendFile", data)
|
|
212
217
|
return MessageId.from_dict(response)
|
|
213
218
|
|
|
@@ -16,8 +16,7 @@ class Dict:
|
|
|
16
16
|
if is_dataclass(value):
|
|
17
17
|
data[field.name] = value.to_dict()
|
|
18
18
|
elif isinstance(value, list):
|
|
19
|
-
data[field.name] = [i.to_dict() if is_dataclass(i)
|
|
20
|
-
else i for i in value]
|
|
19
|
+
data[field.name] = [i.to_dict() if is_dataclass(i)else i for i in value]
|
|
21
20
|
else:
|
|
22
21
|
data[field.name] = value
|
|
23
22
|
return data
|
|
@@ -53,7 +52,9 @@ class Dict:
|
|
|
53
52
|
return cls(**init_data)
|
|
54
53
|
|
|
55
54
|
def to_json(self):
|
|
56
|
-
|
|
55
|
+
data = self.to_dict().copy()
|
|
56
|
+
data.pop("client", None)
|
|
57
|
+
return json.dumps(data, ensure_ascii=False, indent=4)
|
|
57
58
|
|
|
58
59
|
|
|
59
60
|
@dataclass
|
|
@@ -376,7 +377,6 @@ class Chat(Dict):
|
|
|
376
377
|
@dataclass
|
|
377
378
|
class MessageId(Dict):
|
|
378
379
|
message_id: Optional[str] = None
|
|
379
|
-
file_id: Optional[str] = None
|
|
380
380
|
|
|
381
381
|
def __repr__(self):
|
|
382
382
|
return self.to_json()
|
|
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
|