File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed
Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change 1+ # (c) @RknDeveloperr
2+ # Rkn Developer
3+ # Don't Remove Credit 😔
4+ # Telegram Channel @RknDeveloper & @Rkn_Bots
5+ # Developer @RknDeveloperr
6+
7+ import motor .motor_asyncio
8+ from config import Rkn_Bots
9+
10+ client = motor .motor_asyncio .AsyncIOMotorClient (Rkn_Bots .DB_URL )
11+ db = client [Rkn_Bots .DB_NAME ]
12+ chnl_ids = db .chnl_ids
13+ users = db .users
14+
15+ #insert user data
16+ async def insert (user_id ):
17+ user_det = {"_id" : user_id }
18+ try :
19+ await users .insert_one (user_det )
20+ except :
21+ pass
22+
23+ # Total User
24+ async def total_user ():
25+ user = await users .count_documents ({})
26+ return user
27+
28+ async def getid ():
29+ all_users = users .find ({})
30+ return all_users
31+
32+ async def delete (id ):
33+ await users .delete_one (id )
34+
35+ async def addCap (chnl_id , caption ):
36+ dets = {"chnl_id" : chnl_id , "caption" : caption }
37+ await chnl_ids .insert_one (dets )
38+
39+ async def updateCap (chnl_id , caption ):
40+ await chnl_ids .update_one ({"chnl_id" : chnl_id }, {"$set" : {"caption" : caption }})
41+
42+ # Rkn Developer
43+ # Don't Remove Credit 😔
44+ # Telegram Channel @RknDeveloper & @Rkn_Bots
45+ # Developer @RknDeveloperr
You can’t perform that action at this time.
0 commit comments