We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ecfbfaa commit 44fe299Copy full SHA for 44fe299
bot_package/handlers.py
@@ -4,6 +4,7 @@
4
import time
5
import shutil
6
import re
7
+from pymongo import MongoClient
8
from pyrogram import Client, filters
9
from pyrogram.types import CallbackQuery, InlineKeyboardMarkup, InlineKeyboardButton
10
from pyrogram.errors import FloodWait, PeerIdInvalid
@@ -40,6 +41,15 @@
40
41
DL_COMPLETE_BUTTON,
42
) # Assuming buttons.py exists
43
44
+# --- MongoDB Connection ---
45
+pwd = os.getenv('MONGO_PWD')
46
+
47
+# connection string
48
+connection_string = f'mongodb+srv://myAtlasDBUser:{pwd}@pyroytbot.p1vptc2.mongodb.net/?retryWrites=true&w=majority&appName=PyroYtBot'
49
50
+# initialize the client
51
+client = MongoClient(connection_string)
52
53
54
# --- MongoDB tools ---
55
async def mongo_check_user_database(
0 commit comments