async def delete_service(chatid): to_check = await get_service(chatid) if not to_check: return False cli.delete_one({'_id': to_check["_id"], 'chatid': to_check["chatid"]}) return True
async def rm_from_blacklist(chat_id, trigger): to_check = await check_blacklist(chat_id, trigger) if not to_check: return False cli.delete_one({ 'chat_id': to_check["chat_id"], 'trigger': to_check["trigger"] })
async def delete_note(chatid, name): to_check = await get_note(chatid, name) if not to_check: return False cli.delete_one({ '_id': to_check["_id"], 'chat_id': to_check["chat_id"], 'name': to_check["name"], 'text': to_check["text"], })
async def delete_filter(chatid, keyword): to_check = await get_filter(chatid, keyword) if not to_check: return False cli.delete_one({ '_id': to_check["_id"], 'chat_id': to_check["chat_id"], 'keyword': to_check["keyword"] }) return True
async def rm_welcome_setting(chat_id): to_check = await get_current_welcome_settings(chat_id) if not to_check: return False cli.delete_one({ '_id': to_check["_id"], 'chat_id': to_check["chat_id"], 'should_clean_welcome': to_check["should_clean_welcome"], 'previous_welcome': to_check['previous_welcome'], 'f_mesg_id': to_check['f_mesg_id'] }) return True
async def delete_others(): cli.delete_one({"Others": {"$exists": True}})
async def delete_one(key): return cli.delete_one({"Key": key})
async def delete_one(name): return cli.delete_one({"Name": name})
async def unmute_chat(unm_e): """ For .unmutechat command, unmute a muted chat. """ from userbot.database.mongo import cli cli = cli["Userbot"]["mute_chat"] cli.delete_one({"chat_id": unm_e.chat_id}) await unm_e.edit("```Unmuted this chat Successfully```")
async def unmute(chatid, userid): if await is_muted(chatid, userid) is False: return False cli.delete_one({'chat_id': chatid, 'user_id': userid}) return True
async def unload(name): return cli.delete_one({"Name": name})
async def delete(obj): return cli.delete_one({obj: {"$exists": True}})
async def delete_one_blacklist(chat_id, trigger): return cli.delete_one({"chat_id": chat_id, 'trigger': trigger})
async def ungmute(userid): if await is_gmuted(userid) is False: return False cli.delete_one({'user_id': userid}) return True
async def remove_chat_fban(chatid): if await is_fban(chatid) is False: return False cli.delete_one({'chatid': chatid}) return True
async def delete(name): return cli.delete_one({name: {"$exists": True}})
async def rem_chat(chat_id): check = await is_chat(chat_id) if check: cli.delete_one({'chat_id': chat_id}) return True
async def stop_afk(): return cli.delete_one({"Message": {"$exists": True}})