Spaces:
Running
Running
Upload database.py
Browse files- akn/utils/database.py +11 -0
akn/utils/database.py
CHANGED
@@ -100,6 +100,17 @@ class Database:
|
|
100 |
upsert=True
|
101 |
)
|
102 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
103 |
async def fixed_maintance(self, is_maintance):
|
104 |
return await self.maintance_bot.update_one(
|
105 |
{"bot_id": 1},
|
|
|
100 |
upsert=True
|
101 |
)
|
102 |
|
103 |
+
async def set_pic_in_allbot(self, id, link, is_pic):
|
104 |
+
return await self.privary_bot.update_one(
|
105 |
+
{"bot_id": id},
|
106 |
+
{"$set": {"link_pic": link, "is_pic": is_pic}},
|
107 |
+
upsert=True
|
108 |
+
)
|
109 |
+
|
110 |
+
async def get_pic_in_allbot(self, id):
|
111 |
+
user_data = await self.privary_bot.find_one({"bot_id": id})
|
112 |
+
return user_data.get("link_pic"), user_data.get("is_pic") if user_data else False
|
113 |
+
|
114 |
async def fixed_maintance(self, is_maintance):
|
115 |
return await self.maintance_bot.update_one(
|
116 |
{"bot_id": 1},
|