protected function createConnection(int $shardID) {
        if(empty($this->connections[$shardID])) {
            $this->connections[$shardID] = new \CharlotteDunois\Yasmin\WebSocket\WSConnection($this, $shardID, $this->compression);
            
            $this->connections[$shardID]->on('close', function (int $code, string $reason) use ($shardID) {
                $this->client->emit('debug', 'Shard '.$shardID.' disconnected with code '.$code.' and reason "'.$reason.'"');
                
                $shard = $this->client->shards->get($shardID);
                if($shard !== null) {
                    $this->client->emit('disconnect', $shard, $code, $reason);
                }
            });
        }
    }