protected function handleGuildMembersChunk($data)
    {
        $guild   = $this->guilds->get('id', $data->d->guild_id);
        $members = $data->d->members;

        $this->logger->debug('received guild member chunk', ['guild_id' => $guild->id, 'guild_name' => $guild->name, 'member_count' => count($members)]);

        $count = 0;

        foreach ($members as $member) {
            if (array_key_exists($member->user->id, $guild->members)) {
                continue;
            }

            $member             = (array) $member;
            $member['guild_id'] = $guild->id;
            $member['status']   = 'offline';
            $member['game']     = null;

            $memberPart = $this->factory->create(Member::class, $member, true);
            $guild->members->push($memberPart);
            $this->users->push($memberPart->user);
            ++$count;
        }

        $this->logger->debug('parsed '.$count.' members', ['repository_count' => $guild->members->count(), 'actual_count' => $guild->member_count]);

        if ($guild->members->count() >= $guild->member_count) {
            if (($key = array_search($guild->id, $this->largeSent)) !== false) {
                unset($this->largeSent[$key]);
            }

            $this->logger->debug('all users have been loaded', ['guild' => $guild->id, 'member_collection' => $guild->members->count(), 'member_count' => $guild->member_count]);
        }

        if (count($this->largeSent) < 1) {
            $this->ready();
        }
    }
protected function handleGuildMembersChunk($data)
    {
        $guild   = $this->guilds->get('id', $data->d->guild_id);
        $members = $data->d->members;

        $this->logger->debug('received guild member chunk', ['guild_id' => $guild->id, 'guild_name' => $guild->name, 'member_count' => count($members)]);

        $count = 0;

        foreach ($members as $member) {
            if (array_key_exists($member->user->id, $guild->members)) {
                continue;
            }

            $member             = (array) $member;
            $member['guild_id'] = $guild->id;
            $member['status']   = 'offline';
            $member['game']     = null;

            $memberPart = $this->factory->create(Member::class, $member, true);
            $guild->members->push($memberPart);
            $this->users->push($memberPart->user);
            ++$count;
        }

        $this->logger->debug('parsed '.$count.' members', ['repository_count' => $guild->members->count(), 'actual_count' => $guild->member_count]);

        if ($guild->members->count() >= $guild->member_count) {
            if (($key = array_search($guild->id, $this->largeSent)) !== false) {
                unset($this->largeSent[$key]);
            }

            $this->logger->debug('all users have been loaded', ['guild' => $guild->id, 'member_collection' => $guild->members->count(), 'member_count' => $guild->member_count]);
        }

        if (count($this->largeSent) < 1) {
            $this->ready();
        }
    }
protected function handleGuildMembersChunk ( $ data ) { $ guild = $ this -> guilds -> get ( 'id' , $ data -> d -> guild_id ) ; $ members = $ data -> d -> members ; $ this -> logger -> debug ( 'received guild member chunk' , [ 'guild_id' => $ guild -> id , 'guild_name' => $ guild -> name , 'member_count' => count ( $ members ) ] ) ; $ count = 0 ; foreach ( $ members as $ member ) { if ( array_key_exists ( $ member -> user -> id , $ guild -> members ) ) { continue ; } $ member = ( array ) $ member ; $ member [ 'guild_id' ] = $ guild -> id ; $ member [ 'status' ] = 'offline' ; $ member [ 'game' ] = null ; $ memberPart = $ this -> factory -> create ( Member :: class , $ member , true ) ; $ guild -> members -> push ( $ memberPart ) ; $ this -> users -> push ( $ memberPart -> user ) ; ++ $ count ; } $ this -> logger -> debug ( 'parsed ' . $ count . ' members' , [ 'repository_count' => $ guild -> members -> count ( ) , 'actual_count' => $ guild -> member_count ] ) ; if ( $ guild -> members -> count ( ) >= $ guild -> member_count ) { if ( ( $ key = array_search ( $ guild -> id , $ this -> largeSent ) ) !== false ) { unset ( $ this -> largeSent [ $ key ] ) ; } $ this -> logger -> debug ( 'all users have been loaded' , [ 'guild' => $ guild -> id , 'member_collection' => $ guild -> members -> count ( ) , 'member_count' => $ guild -> member_count ] ) ; } if ( count ( $ this -> largeSent ) < 1 ) { $ this -> ready ( ) ; } }
Handles `GUILD_MEMBERS_CHUNK` packets.

@param object $data Packet data.
Handles GUILD_MEMBERS_CHUNK packets .