示例#1
0
def get_user_guilds():
    cache = get_keyvalproperty("OAUTH/USERGUILDS/"+str(make_user_cache_key()))
    if cache:
        return cache
    req = discordrest_from_user("/users/@me/guilds")
    if req.status_code != 200:
        abort(req.status_code)
    req = json.dumps(req.json())
    set_keyvalproperty("OAUTH/USERGUILDS/"+str(make_user_cache_key()), req, 250)
    return req
示例#2
0
 def _set_bucket(self, key, value):
     return set_keyvalproperty(self.global_redis_prefix + key, value)