from .. import adB


def get_stuff():
    return adB.get_key("GBLACKLISTS") or []


def add_gblacklist(id):
    ok = get_stuff()
    if id not in ok:
        ok.append(id)
        return adB.set_key("GBLACKLISTS", ok)


def rem_gblacklist(id):
    ok = get_stuff()
    if id in ok:
        ok.remove(id)
        return adB.set_key("GBLACKLISTS", ok)


def is_gblacklisted(id):
    return id in get_stuff()
