Rubka 1.8.6__tar.gz → 2.11.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Rubka
3
- Version: 1.8.6
3
+ Version: 2.11.9
4
4
  Summary: A Python library for interacting with Rubika Bot API.
5
5
  Home-page: https://github.com/Mahdy-Ahmadi/Rubka
6
6
  Download-URL: https://github.com/Mahdy-Ahmadi/Rubka/archive/refs/tags/v0.1.0.tar.gz
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Rubka
3
- Version: 1.8.6
3
+ Version: 2.11.9
4
4
  Summary: A Python library for interacting with Rubika Bot API.
5
5
  Home-page: https://github.com/Mahdy-Ahmadi/Rubka
6
6
  Download-URL: https://github.com/Mahdy-Ahmadi/Rubka/archive/refs/tags/v0.1.0.tar.gz
@@ -125,11 +125,13 @@ class Robot:
125
125
  message_id = msg.get('message_id')
126
126
  sender_id = msg.get('sender_id')
127
127
  text = msg.get('text')
128
-
128
+ try:
129
+ import time
130
+ if msg.get("time") and (time.time() - float(msg["time"])) > 10:return
131
+ except Exception as e:return
129
132
  if self._message_handler:
130
133
  handler = self._message_handler
131
134
  context = Message(bot=self, chat_id=chat_id, message_id=message_id, sender_id=sender_id, text=text, raw_data=msg)
132
-
133
135
  if handler["commands"]:
134
136
  if not context.text or not context.text.startswith("/"):
135
137
  return
@@ -144,6 +146,7 @@ class Robot:
144
146
  return
145
147
 
146
148
  handler["func"](self, context)
149
+
147
150
  elif update.get('type') == 'ReceiveQuery':
148
151
  msg = update.get("inline_message", {})
149
152
  chat_id = msg.get("chat_id")
@@ -155,6 +158,7 @@ class Robot:
155
158
  context = Message(bot=self, chat_id=chat_id, message_id=message_id, sender_id=sender_id, text=text, raw_data=msg)
156
159
  self._callback_handler(self, context)
157
160
 
161
+
158
162
  def run(self):
159
163
  print("Bot started running...")
160
164
  if self._offset_id is None:
@@ -8,7 +8,7 @@ except FileNotFoundError:
8
8
 
9
9
  setup(
10
10
  name='Rubka',
11
- version='1.8.6',
11
+ version='2.11.9',
12
12
  description='A Python library for interacting with Rubika Bot API.',
13
13
  long_description=long_description,
14
14
  long_description_content_type='text/markdown',
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