telegram_libs 0.1.22__py3-none-any.whl → 0.1.24__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/constants.py +10 -2
- telegram_libs/handlers.py +1 -1
- telegram_libs/mongo.py +0 -3
- telegram_libs/utils.py +7 -11
- {telegram_libs-0.1.22.dist-info → telegram_libs-0.1.24.dist-info}/METADATA +1 -1
- {telegram_libs-0.1.22.dist-info → telegram_libs-0.1.24.dist-info}/RECORD +8 -8
- {telegram_libs-0.1.22.dist-info → telegram_libs-0.1.24.dist-info}/LICENSE +0 -0
- {telegram_libs-0.1.22.dist-info → telegram_libs-0.1.24.dist-info}/WHEEL +0 -0
telegram_libs/constants.py
CHANGED
@@ -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/handlers.py
CHANGED
@@ -49,7 +49,7 @@ def register_common_handlers(
|
|
49
49
|
) -> None:
|
50
50
|
"""Register common handlers for the bot"""
|
51
51
|
bot_logger = BotLogger()
|
52
|
-
app.add_handler(CommandHandler("more", more_bots_list_command))
|
52
|
+
app.add_handler(CommandHandler("more", partial(more_bots_list_command, bot_logger=bot_logger)))
|
53
53
|
|
54
54
|
register_support_handlers(app, bot_name, bot_logger)
|
55
55
|
register_subscription_handlers(app, mongo_manager, bot_logger)
|
telegram_libs/mongo.py
CHANGED
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(
|
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 = "
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
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:"
|
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,17 +1,17 @@
|
|
1
1
|
telegram_libs/__init__.py,sha256=xrsD5r6ZiJxPapHf1UhQ61z2gHtCCWrzW0CZHvlvXRc,82
|
2
|
-
telegram_libs/constants.py,sha256=
|
2
|
+
telegram_libs/constants.py,sha256=GUh8G7CGyI_ZoGBBBiTv3Ku6ad9ecIczjSjLcI8sLo0,946
|
3
3
|
telegram_libs/error.py,sha256=uomabeEiSP4v4AEpKYbi_gR0l3G003sio6lKl72AinY,453
|
4
|
-
telegram_libs/handlers.py,sha256=
|
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=
|
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=
|
14
|
-
telegram_libs-0.1.
|
15
|
-
telegram_libs-0.1.
|
16
|
-
telegram_libs-0.1.
|
17
|
-
telegram_libs-0.1.
|
13
|
+
telegram_libs/utils.py,sha256=laFiG2fs9Wdlsf4Dn4wK7-tF-WTXBfEHBm77QHev9h8,2378
|
14
|
+
telegram_libs-0.1.24.dist-info/LICENSE,sha256=ZXkWPZbCc61L29Gz6ZHPwn1c4Pm0TnfIqtx8jGWi9F4,1069
|
15
|
+
telegram_libs-0.1.24.dist-info/METADATA,sha256=uLJ4jq6vA5A-2bGlPONMVNrvTTV112aGqHmPb9rNKC0,804
|
16
|
+
telegram_libs-0.1.24.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
|
17
|
+
telegram_libs-0.1.24.dist-info/RECORD,,
|
File without changes
|
File without changes
|