def get_all_gmex(): try: return SESSION.query(GMEX).all() except BaseException: return None finally: SESSION.close()
def get_all_s(): try: return SESSION.query(LydiaAI).all() except BaseException: return None finally: SESSION.close()
def is_gban(chat_id): try: return SESSION.query(GBan).filter(GBan.chat_id == str(chat_id)).one() except: return None finally: SESSION.close()
def is_fed_indb(feds): try: return SESSION.query(Fed).filter(Fed.feds == feds).one() except: return None finally: SESSION.close()
def get_all_snips(): try: return SESSION.query(Snips).all() except: return None finally: SESSION.close()
def is_muted(chat_id): try: return SESSION.query(Mute).filter(Mute.chat_id == str(chat_id)).all() except: return None finally: SESSION.close()
def is_chat(chat_id): try: return True if SESSION.query(Chat).get(str(chat_id)) else None except: return False finally: SESSION.close()
def getCommand(command): try: return SESSION.query(CMD).filter(CMD.command == str(command)).one() except BaseException: return None finally: SESSION.close()
def is_approved(chat_id): try: return SESSION.query(NOLogPMs).filter(NOLogPMs.chat_id == chat_id).one() except: return None finally: SESSION.close()
def get_notes(keyword): try: return SESSION.query(notes).get(keyword) except: return None finally: SESSION.close()
def get_all_notes(): try: return SESSION.query(notes).all() except: return None finally: SESSION.close()
def in_channels(chat_id): try: return SESSION.query(fban).filter(fban.chat_id == str(chat_id)).one() except BaseException: return None finally: SESSION.close()
def is_in(user_id): try: return SESSION.query(PMPermits).get(str(user_id)) except BaseException: return None finally: SESSION.close()
def already_added(chat_id): try: return SESSION.query(Moidata).filter(Moidata.chat_id == str(chat_id)).one() except: return None finally: SESSION.close()
def is_folder(folder_id): try: return SESSION.query(Gdrive).filter(Gdrive.cat == str(folder_id)) except BaseException: return None finally: SESSION.close()
def is_folder(folder_id): try: return SESSION.query(Gdrive).filter(Gdrive.wolf == str(folder_id)) except: return None finally: SESSION.close()
def get_parent_id(): try: return SESSION.query(Gdrive).all() except BaseException: return None finally: SESSION.close()
def get_all_filters(chat_id): try: return SESSION.query(Filters).filter(Filters.chat_id == str(chat_id)).all() except: return None finally: SESSION.close()
def all_chat(): try: return SESSION.query(Chat).all() except: return None finally: SESSION.close()
def in_channels(chat_id): try: return SESSION.query(ghdb).filter(ghdb.chat_id == str(chat_id)).one() except: return None finally: SESSION.close()
def is_gmuted(sender_id): try: return SESSION.query(GMute).all() except: return None finally: SESSION.close()
def is_echo(user_id, chat_id): try: return SESSION.query(ECHOSQL).get((str(user_id), str(chat_id))) except: return None finally: SESSION.close()
def get_snips(keyword): try: return SESSION.query(Snips).get(keyword) except: return None finally: SESSION.close()
def get_all_echos(): try: return SESSION.query(ECHOSQL).all() except: return None finally: SESSION.close()
def get_s(user_id, chat_id): try: return SESSION.query(LydiaAI).get((user_id, chat_id)) except BaseException: return None finally: SESSION.close()
def is_approved(chat_id): try: return SESSION.query(PMPermit).filter(PMPermit.chat_id == str(chat_id)).one() except: return None finally: SESSION.close()
def get_current_welcome_settings(chat_id): try: return SESSION.query(Welcome).filter(Welcome.chat_id == str(chat_id)).one() except: return None finally: SESSION.close()
def get_filter(chat_id, keyword): try: return SESSION.query(Filters).get((str(chat_id), keyword)) except: return None finally: SESSION.close()
def is_globelmuted(sender_id): try: return SESSION.query(GLOBELMute).all() except BaseException: return None finally: SESSION.close()
def is_gmex(chat_id): try: return SESSION.query(GMEX).get(str(chat_id)) except BaseException: return None finally: SESSION.close()