Пример #1
0
def init_locks(chat_id, reset=False):
    curr_restr = SESSION.query(Locks).get(str(chat_id))
    if reset:
        SESSION.delete(curr_restr)
        SESSION.flush()
    restr = Locks(str(chat_id))
    SESSION.add(restr)
    SESSION.commit()
    return restr
Пример #2
0
def remove_warn_filter(chat_id, keyword):
    with WARN_FILTER_INSERTION_LOCK:
        warn_filt = SESSION.query(WarnFilters).get((str(chat_id), keyword))
        if warn_filt:
            if keyword in WARN_FILTERS.get(str(chat_id), []):  # sanity check
                WARN_FILTERS.get(str(chat_id), []).remove(keyword)

            SESSION.delete(warn_filt)
            SESSION.commit()
            return True
        SESSION.close()
        return False
Пример #3
0
def unmute(sender, chat_id):
    rem = SESSION.query(Mute).get((str(sender), str(chat_id)))
    if rem:
        SESSION.delete(rem)
        SESSION.commit()
Пример #4
0
def rm_welcome_setting(chat_id):
    rem = SESSION.query(Welcome).get(str(chat_id))
    if rem:
        SESSION.delete(rem)
        SESSION.commit()
Пример #5
0
def rmfed(feds):
    rmfeddy = SESSION.query(Fed).get(feds)
    if rmfeddy:
        SESSION.delete(rmfeddy)
        SESSION.commit()
Пример #6
0
def remove_dataz(chat_id):
    lul = SESSION.query(Pa).get(str(chat_id))
    if lul:
        SESSION.delete(lul)
        SESSION.commit()
Пример #7
0
def ungmute(sender):
    rem = SESSION.query(GMute).get((str(sender)))
    if rem:
        SESSION.delete(rem)
        SESSION.commit()
def rm_tracker(amazon_url: str):
    zaidi = SESSION.query(Anp).get(str(amazon_url))
    if zaidi:
        SESSION.delete(warner)
        SESSION.commit()
Пример #9
0
def disapprove(chat_id):
    rem = SESSION.query(PMPermit).get(str(chat_id))
    if rem:
        SESSION.delete(rem)
        SESSION.commit()
Пример #10
0
def rmping(url):
    rmpinger = SESSION.query(Serverpinger).get(url)
    if rmpinger:
        SESSION.delete(rmpinger)
        SESSION.commit()
Пример #11
0
def rmnightmode(chat_id: str):
    rmnightmoddy = SESSION.query(Nightmode).get(str(chat_id))
    if rmnightmoddy:
        SESSION.delete(rmnightmoddy)
        SESSION.commit()
Пример #12
0
def remove_filter(chat_id, keyword):
    saved_filter = SESSION.query(Filters).get((str(chat_id), keyword))
    if saved_filter:
        SESSION.delete(saved_filter)
        SESSION.commit()