Esempio n. 1
0
def is_gban(chat_id):
    try:
        return SESSION.query(GBan).filter(GBan.chat_id == int(chat_id)).one()
    except:
        return None
    finally:
        SESSION.close()
Esempio n. 2
0
def is_fban(chat_id):
    try:
        return SESSION.query(FBan).filter(FBan.chat_id == str(chat_id)).one()
    except:
        return None
    finally:
        SESSION.close()
Esempio n. 3
0
def is_globelmuted(sender_id):
    try:
        return SESSION.query(GLOBELMute).all()
    except BaseException:
        return None
    finally:
        SESSION.close()
Esempio n. 4
0
def gmutelist():
    try:
        return SESSION.query(GMute).all()
    except BaseException:
        return None
    finally:
        SESSION.close()
Esempio n. 5
0
def is_gmuted(_sender_id):
    try:
        return SESSION.query(GMute).all()
    except BaseException:
        return None
    finally:
        SESSION.close()
Esempio n. 6
0
def is_muted(chat_id):
    try:
        return SESSION.query(Mute).filter(Mute.chat_id == str(chat_id)).all()
    except BaseException:
        return None
    finally:
        SESSION.close()
Esempio n. 7
0
def get_all_snips():
    try:
        return SESSION.query(Snips).all()
    except:
        return None
    finally:
        SESSION.close()
Esempio n. 8
0
def get_s(user_id, chat_id):
    try:
        return SESSION.query(LydiaAI).get((user_id, chat_id))
    except BaseException:
        return None
    finally:
        SESSION.close()
Esempio n. 9
0
def get_current_oqwelcome_settings(chat_id):
    try:
        return SESSION.query(oqwelcome).filter(oqwelcome.chat_id == chat_id).one()
    except:
        return None
    finally:
        SESSION.close()
Esempio n. 10
0
def get_snips(keyword):
    try:
        return SESSION.query(Snips).get(keyword)
    except:
        return None
    finally:
        SESSION.close()
Esempio n. 11
0
def get_approved():
    try:
        return SESSION.query(PMPermit).all()
    except BaseException:
        return None
    finally:
        SESSION.close()
Esempio n. 12
0
def get_collectionlist_items():
    try:
        chats = SESSION.query(
            Petercord_GlobalCollection.keywoard).distinct().all()
        return [i[0] for i in chats]
    finally:
        SESSION.close()
Esempio n. 13
0
def num_collectionlist_items():
    try:
        return SESSION.query(
            func.count(distinct(
                Petercord_GlobalCollection.keywoard))).scalar()
    finally:
        SESSION.close()
Esempio n. 14
0
def is_gmuted(sender_id):
    try:
        return SESSION.query(GMute).filter(GMute.sender == str(sender_id)).all()
    except BaseException:
        return None
    finally:
        SESSION.close()
Esempio n. 15
0
def get_current_welcome_settings(chat_id):
    try:
        return SESSION.query(Welcome).filter(Welcome.chat_id == str(chat_id)).one()
    except BaseException:
        return None
    finally:
        SESSION.close()
Esempio n. 16
0
def is_kread():
    try:
        return SESSION.query(KRead).all()
    except:
        return None
    finally:
        SESSION.close()
Esempio n. 17
0
def gbanlist():
    try:
        return SESSION.query(GBan).all()
    except BaseException:
        return None
    finally:
        SESSION.close()
Esempio n. 18
0
def get_all_s():
    try:
        return SESSION.query(LydiaAI).all()
    except BaseException:
        return None
    finally:
        SESSION.close()
Esempio n. 19
0
def get_blacklist():
    try:
        return SESSION.query(Blacklist).all()
    except BaseException:
        return None
    finally:
        SESSION.close()
Esempio n. 20
0
def get_filter(chat_id, keyword):
    try:
        return SESSION.query(Filters).get((str(chat_id), keyword))
    except:
        return None
    finally:
        SESSION.close()
Esempio n. 21
0
def get_all_oqfilters(chat_id):
    try:
        return SESSION.query(oqfilters).filter(oqfilters.chat_id == str(chat_id)).all()
    except:
        return None
    finally:
        SESSION.close()
def is_gbanned(chat_id):
    try:
        return SESSION.query(GBan).filter(GBan.chat_id == str(chat_id)).one()
    except BaseException:
        return None
    finally:
        SESSION.close()
Esempio n. 23
0
def get_all_bl_users():
    try:
        return SESSION.query(Bot_BlackList).all()
    except BaseException:
        return None
    finally:
        SESSION.close()
Esempio n. 24
0
def is_approved(chat_id):
    try:
        return SESSION.query(PMPermit).filter(PMPermit.chat_id == str(chat_id)).one()
    except:
        return None
    finally:
        SESSION.close()
Esempio n. 25
0
def get_all_echos():
    try:
        return SESSION.query(ECHOSQL).all()
    except BaseException:
        return None
    finally:
        SESSION.close()
Esempio n. 26
0
def is_echo(user_id, chat_id):
    try:
        return SESSION.query(ECHOSQL).get((str(user_id), str(chat_id)))
    except BaseException:
        return None
    finally:
        SESSION.close()
Esempio n. 27
0
def get_all_starters():
    try:
        return SESSION.query(Bot_Starters).all()
    except BaseException:
        return None
    finally:
        SESSION.close()
Esempio n. 28
0
def gvarstatus(variable):
    try:
        return SESSION.query(Globals).filter(
            Globals.variable == str(variable)).first().value
    except BaseException:
        return None
    finally:
        SESSION.close()
Esempio n. 29
0
def __load_flood_settings():
    global CHAT_FLOOD
    try:
        all_chats = SESSION.query(FloodControl).all()
        CHAT_FLOOD = {chat.chat_id: (None, DEF_COUNT, chat.limit) for chat in all_chats}
    finally:
        SESSION.close()
    return CHAT_FLOOD
Esempio n. 30
0
def get_starter_details(user_id):
    try:
        _result = SESSION.query(Bot_Starters).get(str(user_id))
        if _result:
            return _result
        return None
    finally:
        SESSION.close()