Esempio n. 1
0
def num_blacklist_filters():
    try:
        return SESSION.query(BlackListFilters).count()
    finally:
        SESSION.close()
Esempio n. 2
0
def disapprove(chat_id):
    rem = SESSION.query(PMPermit).get(str(chat_id))
    if rem:
        SESSION.delete(rem)
        SESSION.commit()
Esempio n. 3
0
def get_all_approved():
    rem = SESSION.query(PMPermit).all()
    SESSION.close()
    return rem
Esempio n. 4
0
def get_all_channels():
    rem = SESSION.query(ghdb).all()
    SESSION.close()
    return rem
Esempio n. 5
0
def get_locks(chat_id):
    try:
        return SESSION.query(Locks).get(str(chat_id))
    finally:
        SESSION.close()
Esempio n. 6
0
def update_previous_welcome(chat_id, previous_welcome):
    row = SESSION.query(Welcome).get(chat_id)
    row.previous_welcome = previous_welcome
    # commit the changes to the DB
    SESSION.commit()
Esempio n. 7
0
def rm_channel(chat_id):
    rem = SESSION.query(ghdb).get(str(chat_id))
    if rem:
        SESSION.delete(rem)
        SESSION.commit()
Esempio n. 8
0
def rm_welcome_setting(chat_id):
    rem = SESSION.query(Welcome).get(str(chat_id))
    if rem:
        SESSION.delete(rem)
        SESSION.commit()
Esempio n. 9
0
def ungmute(sender):
    rem = SESSION.query(GMute).get((str(sender)))
    if rem:
        SESSION.delete(rem)
        SESSION.commit()
Esempio n. 10
0
def remove_snip(keyword):
    note = SESSION.query(Snips).filter(Snips.snip == keyword)
    if note:
        note.delete()
        SESSION.commit()
Esempio n. 11
0
def unmute(sender, chat_id):
    rem = SESSION.query(Mute).get((str(sender), str(chat_id)))
    if rem:
        SESSION.delete(rem)
        SESSION.commit()
Esempio n. 12
0
def is_muted(sender, chat_id):
    user = SESSION.query(Mute).get((str(sender), str(chat_id)))
    if user:
        return True
    else:
        return False