async def keep_read(message): """ The mute logic. """ from database.mongo import cli cli = cli["Userbot"]["mute_chat"] kread = cli.find({"chat_id": message.chat_id}) if kread: for i in kread: if i["chat_id"] == message.chat_id: await message.client.send_read_acknowledge( entity=message.chat_id, max_id=0, clear_mentions=True)
async def get_all_filters(chatid): return cli.find({'chat_id': chatid})
async def check(): return (False if not list(cli.find({}, {"Others": 0})) else list(cli.find({}, {"Others": 0})))
async def retrieve(): return (False if not [x for x in cli.find({})] else [x for x in cli.find({})])
async def check(): return (False if not [x for x in cli.find({}, {"File": 0})] else [x for x in cli.find({}, {"File": 0})])
async def check_dload(): return (False if not cli.find({"Name": { "$exists": True }}) else cli.find({"Name": { "$exists": True }}))
async def get_muted(chatid): muted_db = cli.find({'chat_id': int(chatid)}) return [user["user_id"] for user in muted_db]
async def get_chat_blacklist(chat_id): return cli.find({'chat_id': chat_id})
async def check_blacklist(chat_id, trigger): return cli.find({'chat_id': chat_id, 'trigger': trigger})
async def retrieve(): return (False if not list(cli.find({})) else list(cli.find({})))
async def get_gmuted(): gmuted_db = cli.find() return [user["user_id"] for user in gmuted_db]
async def get_notes(chatid): return cli.find({'chat_id': chatid})