yepcord / server

Unofficial discord backend implementation in python.
GNU Affero General Public License v3.0
2 stars 1 forks source link

add presences #101

Open github-actions[bot] opened 1 year ago

github-actions[bot] commented 1 year ago

https://github.com/yepcord/server/blob/7147443e5d1ad7225de374da674c1515488be376/server/gateway/gateway.py#L533


                    statuses,
                    guild_id
                ))
        elif op == GatewayOp.GUILD_MEMBERS:
            d = data["d"]
            if not (guild_id := int(d.get("guild_id")[0])): return
            if not (cl := await self.getClientFromSocket(ws)): return
            query = d.get("query", "")
            limit = d.get("limit", 100)
            if limit > 100 or limit < 1:
                limit = 100
            members = await self.core.getGuildMembersGw(GuildId(guild_id), query, limit)
            presences = []  # TODO: add presences
            await cl.esend(GuildMembersChunkEvent(members, presences, guild_id))
        else:
            print("-"*16)
            print(f"  Unknown op code: {op}")