akn-dev / akn /manage /settings_control.py
randydev's picture
fix revert back and update
21bc372
raw
history blame
628 Bytes
from akn.utils.database import db
async def reset_bot_tokendl(callback_uuid: str):
await db.alldl_bot.update_one(
{"bots.uuid": callback_uuid},
{"$unset": {
"bots.$.bot_token": "",
"bots.$.is_active": False,
}}
)
async def verify_bot_ownershipdl(user_id: int, uuids: str) -> bool:
return bool(await db.alldl_bot.find_one({
"user_id": user_id,
"bots.uuid": uuids
}))
async def delete_bot_datadl(callback_uuid: str):
await db.alldl_bot.update_one(
{"bots.uuid": callback_uuid},
{"$pull": {"bots": {"uuid": callback_uuid}}}
)