def num_blacklist_filters():
    try:
        return SESSION.query(BlackListFilters).count()
    finally:
        SESSION.close()
Exemple #2
0
def disapprove(chat_id):
    rem = SESSION.query(PMPermit).get(str(chat_id))
    if rem:
        SESSION.delete(rem)
        SESSION.commit()
Exemple #3
0
def get_all_approved():
    rem = SESSION.query(PMPermit).all()
    SESSION.close()
    return rem
Exemple #4
0
def get_all_channels():
    rem = SESSION.query(ghdb).all()
    SESSION.close()
    return rem
Exemple #5
0
def get_locks(chat_id):
    try:
        return SESSION.query(Locks).get(str(chat_id))
    finally:
        SESSION.close()
Exemple #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()
Exemple #7
0
def rm_channel(chat_id):
    rem = SESSION.query(ghdb).get(str(chat_id))
    if rem:
        SESSION.delete(rem)
        SESSION.commit()
Exemple #8
0
def rm_welcome_setting(chat_id):
    rem = SESSION.query(Welcome).get(str(chat_id))
    if rem:
        SESSION.delete(rem)
        SESSION.commit()
Exemple #9
0
def ungmute(sender):
    rem = SESSION.query(GMute).get((str(sender)))
    if rem:
        SESSION.delete(rem)
        SESSION.commit()
Exemple #10
0
def remove_snip(keyword):
    note = SESSION.query(Snips).filter(Snips.snip == keyword)
    if note:
        note.delete()
        SESSION.commit()
Exemple #11
0
def unmute(sender, chat_id):
    rem = SESSION.query(Mute).get((str(sender), str(chat_id)))
    if rem:
        SESSION.delete(rem)
        SESSION.commit()
Exemple #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