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