Karma
commited on
Commit
·
3ac9750
1
Parent(s):
0056fc3
Create fsub_db.py
Browse files- Database/mongodb/fsub_db.py +18 -0
Database/mongodb/fsub_db.py
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from Infamous.temp import dbname
|
2 |
+
|
3 |
+
fsub = dbname.force_sub
|
4 |
+
|
5 |
+
|
6 |
+
def fs_settings(chat_id: int):
|
7 |
+
_x = fsub.find_one({"chat_id": chat_id})
|
8 |
+
if _x:
|
9 |
+
return _x
|
10 |
+
return None
|
11 |
+
|
12 |
+
|
13 |
+
def add_channel(chat_id: int, channel):
|
14 |
+
fsub.update_one({"chat_id": chat_id}, {"$set": {"channel": channel}}, upsert=True)
|
15 |
+
|
16 |
+
|
17 |
+
def disapprove(chat_id: int):
|
18 |
+
fsub.delete_one({"chat_id": chat_id})
|