telegram_libs 0.1.29__py3-none-any.whl → 0.1.31__py3-none-any.whl

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.
telegram_libs/utils.py CHANGED
@@ -106,13 +106,15 @@ class RateLimitManager:
106
106
  return True
107
107
  return False
108
108
 
109
- async def check_limit_with_response(self, update: Update, context: ContextTypes.DEFAULT_TYPE, user_id: int) -> None:
109
+ async def check_limit_with_response(self, update: Update, context: ContextTypes.DEFAULT_TYPE, user_id: int) -> bool:
110
110
  """Check if user can perform an action and handle the response."""
111
111
  if not self.check_and_increment(user_id):
112
- lang = self.mongo_manager.get_user_info(user_id).get("lang")
112
+ lang = self.mongo_manager.get_user_info(update).get("lang")
113
113
  message = t("rate_limit.exceeded", lang, common=True)
114
114
  await update.message.reply_text(message)
115
115
  await get_subscription_keyboard(update, lang)
116
+ return False
117
+ return True
116
118
 
117
119
  def increment_action_count(self, user_id: int, user_data: dict = None) -> None:
118
120
  """Increment the daily action count for the user."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: telegram_libs
3
- Version: 0.1.29
3
+ Version: 0.1.31
4
4
  Summary: Common libraries for Telegram bots
5
5
  Author: Andrey Gritsaenko gricaenko.95a@gmail.com
6
6
  Requires-Python: >=3.11,<4.0
@@ -10,8 +10,8 @@ telegram_libs/payment.py,sha256=cNb2vnBlYI_6KnTGz-PCM0uKahW2uGjHVn1mGYlYG-4,3564
10
10
  telegram_libs/subscription.py,sha256=NJlh1kcDfasX1XLpkVfe1UbZslpWSC1hXHaum0kfG8A,4693
11
11
  telegram_libs/support.py,sha256=a3BA7g3seVBUMasv65SzxebLayLigA069wvDcStYbCM,2748
12
12
  telegram_libs/translation.py,sha256=8Kb2cgqKKZH4X_i2Le0V_K1imZdoaCzYAca831DOBig,2049
13
- telegram_libs/utils.py,sha256=Y-WwncNugCbmzQjvDg95NEI-bHRIX9Ly6SVuySJjpjo,4698
14
- telegram_libs-0.1.29.dist-info/LICENSE,sha256=ZXkWPZbCc61L29Gz6ZHPwn1c4Pm0TnfIqtx8jGWi9F4,1069
15
- telegram_libs-0.1.29.dist-info/METADATA,sha256=Qi0yn7gicb9WnTwCqyF_EPSZWXCZqEt14vp5Caoi8hA,804
16
- telegram_libs-0.1.29.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
17
- telegram_libs-0.1.29.dist-info/RECORD,,
13
+ telegram_libs/utils.py,sha256=tiWvDiY3Qf9emWS3_OFkq_u544-i9OQP7_T_fCLtOaQ,4742
14
+ telegram_libs-0.1.31.dist-info/LICENSE,sha256=ZXkWPZbCc61L29Gz6ZHPwn1c4Pm0TnfIqtx8jGWi9F4,1069
15
+ telegram_libs-0.1.31.dist-info/METADATA,sha256=qryXExvtavzMilLOXaWwkgHoAreHFkOFkSTlsZIDOJs,804
16
+ telegram_libs-0.1.31.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
17
+ telegram_libs-0.1.31.dist-info/RECORD,,