telegram_libs 0.1.23__py3-none-any.whl → 0.1.25__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.
@@ -2,13 +2,21 @@ import os
2
2
 
3
3
  required_constants = []
4
4
 
5
- BOTS_AMOUNT = os.getenv("BOTS_AMOUNT")
6
5
  MONGO_URI = os.getenv("MONGO_URI")
7
6
  SUBSCRIPTION_DB_NAME = os.getenv("SUBSCRIPTION_DB_NAME")
8
7
  LOGS_DB_NAME = os.getenv("LOGS_DB_NAME", "logs")
9
8
  DEBUG = os.getenv("DEBUG", "False").lower() in ("true", "1", "yes")
9
+ BOTS = {
10
+ "https://t.me/MagMediaBot": "Remove Background",
11
+ "https://t.me/UpscaleImageGBot": "Upscale Image",
12
+ "https://t.me/GenerateBackgroundGBot": "Generate a Background",
13
+ "https://t.me/kudapoyti_go_bot": "Recommend a place to visit",
14
+ "https://t.me/TryOnOutfitGBot": "Try On Outfit",
15
+ "https://t.me/CloneVoiceAIGBot": "Clone Voice AI",
16
+ }
17
+
18
+ BOTS_AMOUNT = len(BOTS)
10
19
 
11
- required_constants.append(("BOTS_AMOUNT", BOTS_AMOUNT))
12
20
  required_constants.append(("MONGO_URI", MONGO_URI))
13
21
  required_constants.append(("SUBSCRIPTION_DB_NAME", SUBSCRIPTION_DB_NAME))
14
22
 
telegram_libs/mongo.py CHANGED
@@ -3,9 +3,6 @@ from pymongo.server_api import ServerApi
3
3
  from telegram_libs.constants import MONGO_URI, DEBUG
4
4
 
5
5
 
6
- # mongo_client = MongoClient(MONGO_URI, server_api=ServerApi("1"))
7
-
8
-
9
6
  class MongoManager:
10
7
  _mongo_client = None
11
8
 
telegram_libs/utils.py CHANGED
@@ -5,7 +5,7 @@ from telegram import (
5
5
  )
6
6
  from telegram import Update
7
7
  from telegram.ext import ContextTypes
8
- from telegram_libs.constants import BOTS_AMOUNT
8
+ from telegram_libs.constants import BOTS, BOTS_AMOUNT
9
9
  from telegram_libs.translation import t
10
10
  from telegram_libs.mongo import MongoManager
11
11
  from telegram_libs.logger import BotLogger
@@ -28,7 +28,7 @@ async def get_subscription_keyboard(update: Update, lang: str) -> InlineKeyboard
28
28
  InlineKeyboardMarkup: Inline keyboard markup
29
29
  """
30
30
  await update.message.reply_text(
31
- t("subscription.info", lang, common=True).format(int(BOTS_AMOUNT) - 1)
31
+ t("subscription.info", lang, common=True).format(BOTS_AMOUNT - 1)
32
32
  )
33
33
  return [
34
34
  [
@@ -51,15 +51,11 @@ async def more_bots_list_command(update: Update, context: ContextTypes.DEFAULT_T
51
51
  user_id = update.effective_user.id
52
52
  bot_name = context.bot.name
53
53
  bot_logger.log_action(user_id, "more_bots_list_command", bot_name)
54
- message = """Here is the list of all bots:
55
-
56
-
57
- - <a href="https://t.me/MagMediaBot">Remove Background</a>
58
- - <a href="https://t.me/UpscaleImageGBot">Upscale Image</a>
59
- - <a href="https://t.me/GenerateBackgroundGBot">Generate a Background</a>
60
- - <a href="https://t.me/kudapoyti_go_bot">Recommend a place to visit</a>
61
- - <a href="https://t.me/TryOnOutfitGBot">Try On Outfit</a>
62
- """
54
+ message = "Here is the list of all bots:\n\n"
55
+ bots_list = "\n".join(
56
+ f"- <a href='{url}'>{name}</a>" for url, name in BOTS.items()
57
+ )
58
+ message += bots_list
63
59
  await update.message.reply_text(message, disable_web_page_preview=True, parse_mode='HTML')
64
60
 
65
61
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: telegram_libs
3
- Version: 0.1.23
3
+ Version: 0.1.25
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
@@ -1,17 +1,17 @@
1
1
  telegram_libs/__init__.py,sha256=xrsD5r6ZiJxPapHf1UhQ61z2gHtCCWrzW0CZHvlvXRc,82
2
- telegram_libs/constants.py,sha256=cGQBM1z3jmh00pHQlBP-SbbPqKGOxlCRVUsrsThkWCU,655
2
+ telegram_libs/constants.py,sha256=GUh8G7CGyI_ZoGBBBiTv3Ku6ad9ecIczjSjLcI8sLo0,946
3
3
  telegram_libs/error.py,sha256=uomabeEiSP4v4AEpKYbi_gR0l3G003sio6lKl72AinY,453
4
4
  telegram_libs/handlers.py,sha256=d5-4FvjyWcJeN1i3dHTYhF-2P4j7PbM1QElloFR_llg,2417
5
5
  telegram_libs/locales/en.json,sha256=4VVkME7lCKW6ZjkopaoA6Uq3DLbEVkWacGei3GNSXFM,843
6
6
  telegram_libs/locales/ru.json,sha256=LYI6rAlwdNLaTGgkrALn31Lt7jC3SZteei8P_i7ZpQI,1208
7
7
  telegram_libs/logger.py,sha256=oikvkZMk2kOLvQI9hVMUGMCoSnOPf_fhMvv2SbO-STo,891
8
- telegram_libs/mongo.py,sha256=urUvtIamU_WAqf1S6fDiX4ZOzOaTuRph-ovACKIAjlM,2519
8
+ telegram_libs/mongo.py,sha256=MmnW7wgdZNz4jyhjYSx_CLsLasdiXt2tGenOFhTTVTw,2450
9
9
  telegram_libs/payment.py,sha256=PSoagCTUt4xad-39kVYc2tcFgaPMQsP9eplCVqI9hnc,3661
10
10
  telegram_libs/subscription.py,sha256=PFgoWKgjRrjzBjK-AMrESt_7aFk0pa8Qr_Wl1aQIoW8,6430
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=wgkFCziQq4F3z-2AFMirgyY-EDu9D863vQy2ZkjPZSg,2605
14
- telegram_libs-0.1.23.dist-info/LICENSE,sha256=ZXkWPZbCc61L29Gz6ZHPwn1c4Pm0TnfIqtx8jGWi9F4,1069
15
- telegram_libs-0.1.23.dist-info/METADATA,sha256=NxvwcDMnFEoxIJItsd6YkWQsFbICGglG-CsD-ISr2_k,804
16
- telegram_libs-0.1.23.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
17
- telegram_libs-0.1.23.dist-info/RECORD,,
13
+ telegram_libs/utils.py,sha256=9TzQt6PD_BAO5uHoYpReIM5mNeW0AcEHe-bihmIueEk,2382
14
+ telegram_libs-0.1.25.dist-info/LICENSE,sha256=ZXkWPZbCc61L29Gz6ZHPwn1c4Pm0TnfIqtx8jGWi9F4,1069
15
+ telegram_libs-0.1.25.dist-info/METADATA,sha256=PGXZNQT0UTM3ahHdZ3DriNY4PZOjiv2ah4bCVGLlNV8,804
16
+ telegram_libs-0.1.25.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
17
+ telegram_libs-0.1.25.dist-info/RECORD,,