Esempio n. 1
0
def get_online_discord_users(guild_id, embed):
    apimembers = redisqueue.list_guild_members(guild_id)
    apimembers_filtered = {}
    for member in apimembers:
        apimembers_filtered[int(member["id"])] = member
    guild_roles = redisqueue.get_guild(guild_id)["roles"]
    guildroles_filtered = {}
    for role in guild_roles:
        guildroles_filtered[role["id"]] = role
    for member in embed['members']:
        apimem = apimembers_filtered.get(int(member["id"]))
        member["hoist-role"] = None
        member["color"] = None
        if apimem:
            member["hoist-role"] = apimem["hoist-role"]
            member["color"] = apimem["color"]
            member["avatar"] = apimem["avatar"]
            member["avatar_url"] = apimem["avatar_url"]
    return embed['members']
Esempio n. 2
0
def get_all_users(guild_id):
    users = redisqueue.list_guild_members(guild_id)
    mem = []
    for u in users:
        mem.append({
            "id":
            str(u["id"]),
            "avatar":
            u["avatar"],
            "avatar_url":
            generate_avatar_url(u["id"], u["avatar"], u["discriminator"],
                                True),
            "username":
            u["username"],
            "nickname":
            u["nick"],
            "discriminator":
            u["discriminator"]
        })
    return mem