Beispiel #1
0
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()
Beispiel #2
0
def is_id_added(chat_id):
    try:
        return SESSION.query(Blockedid).filter(
            Blockedid.chat_id == str(chat_id)).one()
    except:
        return None
    finally:
        SESSION.close()
Beispiel #3
0
def get_all_channels():
    rem = SESSION.query(fban).all()
    SESSION.close()
    return rem
Beispiel #4
0
def rm_channel(chat_id):
    rem = SESSION.query(fban).get(str(chat_id))
    if rem:
        SESSION.delete(rem)
        SESSION.commit()
Beispiel #5
0
def add_channel(chat_id):
    adder = fban(str(chat_id))
    SESSION.add(adder)
    SESSION.commit()
Beispiel #6
0
def removeid(chat_id):
    safai = SESSION.query(Blockedid).get(str(chat_id))
    if safai:
        SESSION.delete(safai)
        SESSION.commit()
Beispiel #7
0
def get_all_nibba():
    eberyone = SESSION.query(Blockedid).all()
    SESSION.close()
    return eberyone
Beispiel #8
0
def add_in_db(chat_id: int):
    lodu = Blockedid(str(chat_id))
    SESSION.add(lodu)
    SESSION.commit()