forked from Itz-fork/Unzipper-Bot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Still not tested tho
- Loading branch information
Showing
5 changed files
with
124 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Copyright (c) 2022 Itz-fork | ||
# Don't kang this else your dad is gae | ||
|
||
from . import unzipper_db | ||
|
||
spl_db = unzipper_db["splitted_archive_users"] | ||
|
||
|
||
async def add_split_arc_user(uid: int, fn: str, passw: str): | ||
is_exist = await spl_db.find_one({"_id": uid}) | ||
if is_exist: | ||
await spl_db.insert_one({"_id": uid, "file_name": fn, "password": passw}) | ||
else: | ||
raise ValueError("Data already exists!") | ||
|
||
|
||
async def get_split_arc_user(uid: int): | ||
gsau = await spl_db.find_one({"_id": uid}) | ||
if gsau: | ||
return True, gsau["file_name"] | ||
else: | ||
return False, None | ||
|
||
|
||
async def del_split_arc_user(uid: int): | ||
is_exist = await spl_db.find_one({"_id": uid}) | ||
if is_exist: | ||
await spl_db.delete_one({"_id": uid}) | ||
else: | ||
return |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters